Selaa lähdekoodia

some more cleanup

Brendan Forster 9 vuotta sitten
vanhempi
sitoutus
eea207f5d2

+ 3 - 2
Ix.NET/Source/System.Interactive.Async/IgnoreElements.cs

@@ -2,9 +2,8 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 // See the LICENSE file in the project root for more information. 
 
 
-using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Linq;
+using System.Diagnostics;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -27,6 +26,8 @@ namespace System.Linq
 
 
             public IgnoreElementsAsyncIterator(IAsyncEnumerable<TSource> source)
             public IgnoreElementsAsyncIterator(IAsyncEnumerable<TSource> source)
             {
             {
+                Debug.Assert(source != null);
+
                 this.source = source;
                 this.source = source;
             }
             }
 
 

+ 5 - 2
Ix.NET/Source/System.Interactive.Async/Intersect.cs

@@ -2,9 +2,8 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 // See the LICENSE file in the project root for more information. 
 
 
-using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Linq;
+using System.Diagnostics;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -50,6 +49,10 @@ namespace System.Linq
 
 
             public IntersectAsyncIterator(IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
             public IntersectAsyncIterator(IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
             {
             {
+                Debug.Assert(first != null);
+                Debug.Assert(second != null);
+                Debug.Assert(comparer != null);
+
                 this.first = first;
                 this.first = first;
                 this.second = second;
                 this.second = second;
                 this.comparer = comparer;
                 this.comparer = comparer;

+ 1 - 4
Ix.NET/Source/System.Interactive.Async/Join.cs

@@ -2,10 +2,8 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 // See the LICENSE file in the project root for more information. 
 
 
-using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Diagnostics;
-using System.Linq;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -57,8 +55,6 @@ namespace System.Linq
             private readonly IEqualityComparer<TKey> comparer;
             private readonly IEqualityComparer<TKey> comparer;
 
 
             private IAsyncEnumerator<TOuter> outerEnumerator;
             private IAsyncEnumerator<TOuter> outerEnumerator;
- 
-
 
 
             public JoinAsyncIterator(IAsyncEnumerable<TOuter> outer, IAsyncEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey> comparer)
             public JoinAsyncIterator(IAsyncEnumerable<TOuter> outer, IAsyncEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey> comparer)
             {
             {
@@ -67,6 +63,7 @@ namespace System.Linq
                 Debug.Assert(outerKeySelector != null);
                 Debug.Assert(outerKeySelector != null);
                 Debug.Assert(innerKeySelector != null);
                 Debug.Assert(innerKeySelector != null);
                 Debug.Assert(resultSelector != null);
                 Debug.Assert(resultSelector != null);
+                Debug.Assert(comparer != null);
 
 
                 this.outer = outer;
                 this.outer = outer;
                 this.inner = inner;
                 this.inner = inner;

+ 1 - 1
Ix.NET/Source/System.Interactive.Async/Lookup.cs

@@ -351,7 +351,7 @@ namespace System.Linq.Internal
 
 
         IAsyncEnumerator<IGrouping<TKey, TElement>> IAsyncEnumerable<IGrouping<TKey, TElement>>.GetEnumerator()
         IAsyncEnumerator<IGrouping<TKey, TElement>> IAsyncEnumerable<IGrouping<TKey, TElement>>.GetEnumerator()
         {
         {
-            return this.ToAsyncEnumerable<IGrouping<TKey, TElement>>().GetEnumerator();
+            return this.ToAsyncEnumerable().GetEnumerator();
         }
         }
 
 
         public Task<IGrouping<TKey, TElement>[]> ToArrayAsync(CancellationToken cancellationToken)
         public Task<IGrouping<TKey, TElement>[]> ToArrayAsync(CancellationToken cancellationToken)