Selaa lähdekoodia

Some more code cosmetics.

Bart De Smet 8 vuotta sitten
vanhempi
sitoutus
4eb53305bd

+ 3 - 12
Ix.NET/Source/System.Interactive.Async/GroupJoin.cs

@@ -2,10 +2,7 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
 using System.Threading.Tasks;
 
 namespace System.Linq
@@ -27,7 +24,6 @@ namespace System.Linq
             if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));
 
-
             return new GroupJoinAsyncEnumerable<TOuter, TInner, TKey, TResult>(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer);
         }
 
@@ -47,9 +43,6 @@ namespace System.Linq
             return outer.GroupJoin(inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer<TKey>.Default);
         }
 
-       
-
-
         private sealed class GroupJoinAsyncEnumerable<TOuter, TInner, TKey, TResult> : IAsyncEnumerable<TResult>
         {
             private readonly IEqualityComparer<TKey> _comparer;
@@ -114,16 +107,14 @@ namespace System.Linq
                 public async Task<bool> MoveNextAsync()
                 {
                     // nothing to do 
-                    if (!await _outer.MoveNextAsync()
-                                     .ConfigureAwait(false))
+                    if (!await _outer.MoveNextAsync().ConfigureAwait(false))
                     {
                         return false;
                     }
 
                     if (_lookup == null)
                     {
-                        _lookup = await Internal.Lookup<TKey, TInner>.CreateForJoinAsync(_inner, _innerKeySelector, _comparer)
-                                                .ConfigureAwait(false);
+                        _lookup = await Internal.Lookup<TKey, TInner>.CreateForJoinAsync(_inner, _innerKeySelector, _comparer).ConfigureAwait(false);
                     }
 
                     var item = _outer.Current;
@@ -137,4 +128,4 @@ namespace System.Linq
             }
         }
     }
-}
+}

+ 3 - 6
Ix.NET/Source/System.Interactive.Async/Grouping.cs

@@ -5,7 +5,6 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Runtime.ExceptionServices;
 using System.Threading;
 using System.Threading.Tasks;
 
@@ -74,8 +73,7 @@ namespace System.Linq
             if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));
 
-            return source.GroupBy(keySelector, elementSelector, comparer)
-                         .Select(g => resultSelector(g.Key, g));
+            return source.GroupBy(keySelector, elementSelector, comparer).Select(g => resultSelector(g.Key, g));
         }
 
         public static IAsyncEnumerable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IAsyncEnumerable<TElement>, TResult> resultSelector)
@@ -89,8 +87,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw new ArgumentNullException(nameof(resultSelector));
 
-            return source.GroupBy(keySelector, elementSelector, EqualityComparer<TKey>.Default)
-                         .Select(g => resultSelector(g.Key, g));
+            return source.GroupBy(keySelector, elementSelector, EqualityComparer<TKey>.Default).Select(g => resultSelector(g.Key, g));
         }
 
         public static IAsyncEnumerable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IAsyncEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey> comparer)
@@ -509,4 +506,4 @@ namespace System.Linq.Internal
             return this.ToAsyncEnumerable().GetAsyncEnumerator();
         }
     }
-}
+}