소스 검색

Reduce code in DefaultIfEmpty.

Bart De Smet 6 년 전
부모
커밋
fab4165c01
1개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 7
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/DefaultIfEmpty.cs

+ 2 - 7
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/DefaultIfEmpty.cs

@@ -12,13 +12,8 @@ namespace System.Linq
 {
     public static partial class AsyncEnumerable
     {
-        public static IAsyncEnumerable<TSource> DefaultIfEmpty<TSource>(this IAsyncEnumerable<TSource> source)
-        {
-            if (source == null)
-                throw Error.ArgumentNull(nameof(source));
-
-            return new DefaultIfEmptyAsyncIterator<TSource>(source, default);
-        }
+        public static IAsyncEnumerable<TSource> DefaultIfEmpty<TSource>(this IAsyncEnumerable<TSource> source) =>
+            DefaultIfEmpty(source, default);
 
         public static IAsyncEnumerable<TSource> DefaultIfEmpty<TSource>(this IAsyncEnumerable<TSource> source, TSource defaultValue)
         {