Browse Source

No more hiding for AsAsyncEnumerable.

Bart De Smet 7 years ago
parent
commit
63515ad6f9
1 changed files with 2 additions and 6 deletions
  1. 2 6
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.cs

+ 2 - 6
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.cs

@@ -8,12 +8,8 @@ namespace System.Linq
 {
     public static partial class AsyncEnumerable
     {
-        public static IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this IAsyncEnumerable<TSource> source)
-        {
-            if (source == null)
-                throw Error.ArgumentNull(nameof(source));
+        // NB: Synchronous LINQ to Objects doesn't hide the implementation of the source either.
 
-            return source.Select(x => x);
-        }
+        public static IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this IAsyncEnumerable<TSource> source) => source;
     }
 }