浏览代码

No more hiding for AsAsyncEnumerable.

Bart De Smet 7 年之前
父节点
当前提交
63515ad6f9
共有 1 个文件被更改,包括 2 次插入6 次删除
  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 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;
     }
     }
 }
 }