Browse Source

Reduce code duplication in Distinct.

Bart De Smet 6 years ago
parent
commit
b2cc797263
1 changed files with 1 additions and 7 deletions
  1. 1 7
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Distinct.cs

+ 1 - 7
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Distinct.cs

@@ -11,13 +11,7 @@ namespace System.Linq
 {
     public static partial class AsyncEnumerable
     {
-        public static IAsyncEnumerable<TSource> Distinct<TSource>(this IAsyncEnumerable<TSource> source)
-        {
-            if (source == null)
-                throw Error.ArgumentNull(nameof(source));
-
-            return new DistinctAsyncIterator<TSource>(source, comparer: null);
-        }
+        public static IAsyncEnumerable<TSource> Distinct<TSource>(this IAsyncEnumerable<TSource> source) => Distinct(source, comparer: null);
 
         public static IAsyncEnumerable<TSource> Distinct<TSource>(this IAsyncEnumerable<TSource> source, IEqualityComparer<TSource> comparer)
         {