|
@@ -10,27 +10,26 @@ namespace System.Linq
|
|
|
{
|
|
|
public static partial class AsyncEnumerable
|
|
|
{
|
|
|
- public static IAsyncEnumerable<TSource> Intersect<TSource>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
|
|
|
+ public static IAsyncEnumerable<TSource> Intersect<TSource>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second)
|
|
|
{
|
|
|
if (first == null)
|
|
|
throw new ArgumentNullException(nameof(first));
|
|
|
if (second == null)
|
|
|
throw new ArgumentNullException(nameof(second));
|
|
|
- if (comparer == null)
|
|
|
- throw new ArgumentNullException(nameof(comparer));
|
|
|
|
|
|
- return new IntersectAsyncIterator<TSource>(first, second, comparer);
|
|
|
+ return first.Intersect(second, EqualityComparer<TSource>.Default);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public static IAsyncEnumerable<TSource> Intersect<TSource>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second)
|
|
|
+ public static IAsyncEnumerable<TSource> Intersect<TSource>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
|
|
|
{
|
|
|
if (first == null)
|
|
|
throw new ArgumentNullException(nameof(first));
|
|
|
if (second == null)
|
|
|
throw new ArgumentNullException(nameof(second));
|
|
|
+ if (comparer == null)
|
|
|
+ throw new ArgumentNullException(nameof(comparer));
|
|
|
|
|
|
- return first.Intersect(second, EqualityComparer<TSource>.Default);
|
|
|
+ return new IntersectAsyncIterator<TSource>(first, second, comparer);
|
|
|
}
|
|
|
|
|
|
private sealed class IntersectAsyncIterator<TSource> : AsyncIterator<TSource>
|