Browse Source

More code cosmetics.

Bart De Smet 8 years ago
parent
commit
debb67bdf4

+ 2 - 4
Ix.NET/Source/System.Interactive.Async/Finally.cs

@@ -4,7 +4,6 @@
 
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Threading;
 using System.Threading.Tasks;
 
 namespace System.Linq
@@ -65,8 +64,7 @@ namespace System.Linq
                         goto case AsyncIteratorState.Iterating;
 
                     case AsyncIteratorState.Iterating:
-                        if (await enumerator.MoveNextAsync()
-                                            .ConfigureAwait(false))
+                        if (await enumerator.MoveNextAsync().ConfigureAwait(false))
                         {
                             current = enumerator.Current;
                             return true;
@@ -80,4 +78,4 @@ namespace System.Linq
             }
         }
     }
-}
+}

+ 4 - 10
Ix.NET/Source/System.Interactive.Async/ForEach.cs

@@ -2,9 +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;
 
@@ -32,7 +30,6 @@ namespace System.Linq
             source.ForEach(action, CancellationToken.None);
         }
 
-
         public static void ForEach<TSource>(this IAsyncEnumerable<TSource> source, Action<TSource> action, CancellationToken cancellationToken)
         {
             if (source == null)
@@ -40,8 +37,7 @@ namespace System.Linq
             if (action == null)
                 throw new ArgumentNullException(nameof(action));
 
-            source.ForEachAsync(action, cancellationToken)
-                  .Wait(cancellationToken);
+            source.ForEachAsync(action, cancellationToken).Wait(cancellationToken);
         }
 
         public static void ForEach<TSource>(this IAsyncEnumerable<TSource> source, Action<TSource, int> action, CancellationToken cancellationToken)
@@ -51,8 +47,7 @@ namespace System.Linq
             if (action == null)
                 throw new ArgumentNullException(nameof(action));
 
-            source.ForEachAsync(action, cancellationToken)
-                  .Wait(cancellationToken);
+            source.ForEachAsync(action, cancellationToken).Wait(cancellationToken);
         }
 
         public static Task ForEachAsync<TSource>(this IAsyncEnumerable<TSource> source, Action<TSource> action)
@@ -103,8 +98,7 @@ namespace System.Linq
 
             try
             {
-                while (await e.MoveNextAsync(cancellationToken)
-                              .ConfigureAwait(false))
+                while (await e.MoveNextAsync(cancellationToken).ConfigureAwait(false))
                 {
                     action(e.Current, checked(index++));
                 }
@@ -115,4 +109,4 @@ namespace System.Linq
             }
         }
     }
-}
+}

+ 1 - 2
Ix.NET/Source/System.Interactive.Async/Generate.cs

@@ -4,7 +4,6 @@
 
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Threading;
 using System.Threading.Tasks;
 
 namespace System.Linq
@@ -91,4 +90,4 @@ namespace System.Linq
             }
         }
     }
-}
+}