Browse Source

Removing some more dead code.

Bart De Smet 8 years ago
parent
commit
41b86f838e

+ 0 - 12
Ix.NET/Source/System.Interactive.Async/AsyncIterator.cs

@@ -12,7 +12,6 @@ namespace System.Linq
     {
         private readonly int threadId;
 
-        private CancellationTokenSource cancellationTokenSource;
         private bool currentIsInvalid = true;
 
         internal TSource current;
@@ -30,7 +29,6 @@ namespace System.Linq
                 : Clone();
 
             enumerator.state = AsyncIteratorState.Allocated;
-            enumerator.cancellationTokenSource = new CancellationTokenSource();
 
             try
             {
@@ -47,16 +45,6 @@ namespace System.Linq
 
         public virtual Task DisposeAsync()
         {
-            if (cancellationTokenSource != null)
-            {
-                if (!cancellationTokenSource.IsCancellationRequested)
-                {
-                    cancellationTokenSource.Cancel();
-                }
-
-                cancellationTokenSource.Dispose();
-            }
-
             current = default(TSource);
             state = AsyncIteratorState.Disposed;
 

+ 0 - 12
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncIterator.cs

@@ -12,7 +12,6 @@ namespace System.Linq
     {
         private readonly int threadId;
 
-        private CancellationTokenSource cancellationTokenSource;
         private bool currentIsInvalid = true;
 
         internal TSource current;
@@ -30,7 +29,6 @@ namespace System.Linq
                 : Clone();
 
             enumerator.state = AsyncIteratorState.Allocated;
-            enumerator.cancellationTokenSource = new CancellationTokenSource();
 
             try
             {
@@ -47,16 +45,6 @@ namespace System.Linq
 
         public virtual Task DisposeAsync()
         {
-            if (cancellationTokenSource != null)
-            {
-                if (!cancellationTokenSource.IsCancellationRequested)
-                {
-                    cancellationTokenSource.Cancel();
-                }
-
-                cancellationTokenSource.Dispose();
-            }
-
             current = default(TSource);
             state = AsyncIteratorState.Disposed;