瀏覽代碼

Style consistency for new code

Bart De Smet 6 年之前
父節點
當前提交
962fc99716
共有 32 個文件被更改,包括 120 次插入120 次删除
  1. 1 1
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Amb.cs
  2. 3 3
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Buffer.cs
  3. 6 6
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Concat.cs
  4. 3 3
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Defer.cs
  5. 11 11
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/DistinctUntilChanged.cs
  6. 3 3
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Expand.cs
  7. 2 2
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Finally.cs
  8. 1 1
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Generate.cs
  9. 7 7
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Merge.cs
  10. 2 2
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Repeat.cs
  11. 9 9
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Scan.cs
  12. 6 6
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Using.cs
  13. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerableHelpers.cs
  14. 6 6
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs
  15. 3 3
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs
  16. 3 3
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs
  17. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs
  18. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs
  19. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Contains.cs
  20. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs
  21. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs
  22. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs
  23. 6 6
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs
  24. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs
  25. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs
  26. 9 9
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Lookup.cs
  27. 6 6
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs
  28. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SequenceEqual.cs
  29. 6 6
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs
  30. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs
  31. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs
  32. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs

+ 1 - 1
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Amb.cs

@@ -191,7 +191,7 @@ namespace System.Linq
 
                 var winnerIndex = Array.IndexOf(moveNexts, moveNextWinner);
 
-                IAsyncEnumerator<TSource> winner = enumerators[winnerIndex];
+                var winner = enumerators[winnerIndex];
 
                 var loserCleanupTasks = new List<Task>(n - 1);
 

+ 3 - 3
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Buffer.cs

@@ -25,7 +25,7 @@ namespace System.Linq
             {
                 var buffer = new List<TSource>(count);
 
-                await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     buffer.Add(item);
 
@@ -63,9 +63,9 @@ namespace System.Linq
             {
                 var buffers = new Queue<IList<TSource>>();
 
-                int index = 0;
+                var index = 0;
 
-                await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     if (index++ % skip == 0)
                     {

+ 6 - 6
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Concat.cs

@@ -21,9 +21,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                await foreach (IAsyncEnumerable<TSource> source in sources.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var source in sources.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }
@@ -44,9 +44,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                foreach (IAsyncEnumerable<TSource> source in sources)
+                foreach (var source in sources)
                 {
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }
@@ -67,9 +67,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                foreach (IAsyncEnumerable<TSource> source in sources)
+                foreach (var source in sources)
                 {
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }

+ 3 - 3
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Defer.cs

@@ -21,7 +21,7 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                await foreach (TSource item in factory().WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in factory().WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     yield return item;
                 }
@@ -41,7 +41,7 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                await foreach (TSource item in (await factory().ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in (await factory().ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     yield return item;
                 }
@@ -62,7 +62,7 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                await foreach (TSource item in (await factory(cancellationToken).ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in (await factory(cancellationToken).ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     yield return item;
                 }

+ 11 - 11
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/DistinctUntilChanged.cs

@@ -112,13 +112,13 @@ namespace System.Linq
                         yield break;
                     }
 
-                    TSource latest = e.Current;
+                    var latest = e.Current;
 
                     yield return latest;
 
                     while (await e.MoveNextAsync())
                     {
-                        TSource item = e.Current;
+                        var item = e.Current;
 
                         if (!comparer.Equals(latest, item))
                         {
@@ -159,9 +159,9 @@ namespace System.Linq
                         yield break;
                     }
 
-                    TSource item = e.Current;
+                    var item = e.Current;
 
-                    TKey latestKey = keySelector(item);
+                    var latestKey = keySelector(item);
 
                     yield return item;
 
@@ -169,7 +169,7 @@ namespace System.Linq
                     {
                         item = e.Current;
 
-                        TKey currentKey = keySelector(item);
+                        var currentKey = keySelector(item);
 
                         if (!comparer.Equals(latestKey, currentKey))
                         {
@@ -210,9 +210,9 @@ namespace System.Linq
                         yield break;
                     }
 
-                    TSource item = e.Current;
+                    var item = e.Current;
 
-                    TKey latestKey = await keySelector(item).ConfigureAwait(false);
+                    var latestKey = await keySelector(item).ConfigureAwait(false);
 
                     yield return item;
 
@@ -220,7 +220,7 @@ namespace System.Linq
                     {
                         item = e.Current;
 
-                        TKey currentKey = await keySelector(item).ConfigureAwait(false);
+                        var currentKey = await keySelector(item).ConfigureAwait(false);
 
                         if (!comparer.Equals(latestKey, currentKey))
                         {
@@ -262,9 +262,9 @@ namespace System.Linq
                         yield break;
                     }
 
-                    TSource item = e.Current;
+                    var item = e.Current;
 
-                    TKey latestKey = await keySelector(item, cancellationToken).ConfigureAwait(false);
+                    var latestKey = await keySelector(item, cancellationToken).ConfigureAwait(false);
 
                     yield return item;
 
@@ -272,7 +272,7 @@ namespace System.Linq
                     {
                         item = e.Current;
 
-                        TKey currentKey = await keySelector(item, cancellationToken).ConfigureAwait(false);
+                        var currentKey = await keySelector(item, cancellationToken).ConfigureAwait(false);
 
                         if (!comparer.Equals(latestKey, currentKey))
                         {

+ 3 - 3
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Expand.cs

@@ -29,7 +29,7 @@ namespace System.Linq
 
                 while (queue.Count > 0)
                 {
-                    await foreach (TSource item in queue.Dequeue().WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in queue.Dequeue().WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         queue.Enqueue(selector(item));
 
@@ -60,7 +60,7 @@ namespace System.Linq
 
                 while (queue.Count > 0)
                 {
-                    await foreach (TSource item in queue.Dequeue().WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in queue.Dequeue().WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         queue.Enqueue(await selector(item).ConfigureAwait(false));
 
@@ -92,7 +92,7 @@ namespace System.Linq
 
                 while (queue.Count > 0)
                 {
-                    await foreach (TSource item in queue.Dequeue().WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in queue.Dequeue().WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         queue.Enqueue(await selector(item, cancellationToken).ConfigureAwait(false));
 

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

@@ -25,7 +25,7 @@ namespace System.Linq
             {
                 try
                 {
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }
@@ -54,7 +54,7 @@ namespace System.Linq
             {
                 try
                 {
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }

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

@@ -26,7 +26,7 @@ namespace System.Linq
 #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
             {
-                for (TState state = initialState; condition(state); state = iterate(state))
+                for (var state = initialState; condition(state); state = iterate(state))
                 {
                     // REVIEW: Check for cancellation?
 

+ 7 - 7
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Merge.cs

@@ -184,7 +184,7 @@ namespace System.Linq
                 {
                     for (var i = 0; i < count; i++)
                     {
-                        IAsyncEnumerator<TSource> enumerator = sources[i].GetAsyncEnumerator(cancellationToken);
+                        var enumerator = sources[i].GetAsyncEnumerator(cancellationToken);
                         enumerators[i] = enumerator;
 
                         // REVIEW: This follows the lead of the original implementation where we kick off MoveNextAsync
@@ -196,7 +196,7 @@ namespace System.Linq
                         moveNextTasks[i] = enumerator.MoveNextAsync().AsTask();
                     }
 
-                    int active = count;
+                    var active = count;
 
                     while (active > 0)
                     {
@@ -211,9 +211,9 @@ namespace System.Linq
                         //         the use of IndexOf may pick an element closer to the start of the array because of
                         //         reference equality checks and aliasing effects. See GetTaskForResult in the BCL.
 
-                        int index = Array.IndexOf(moveNextTasks, moveNextTask);
+                        var index = Array.IndexOf(moveNextTasks, moveNextTask);
 
-                        IAsyncEnumerator<TSource> enumerator = enumerators[index];
+                        var enumerator = enumerators[index];
 
                         if (!await moveNextTask.ConfigureAwait(false))
                         {
@@ -229,7 +229,7 @@ namespace System.Linq
                         }
                         else
                         {
-                            TSource item = enumerator.Current;
+                            var item = enumerator.Current;
 
                             moveNextTasks[index] = enumerator.MoveNextAsync().AsTask();
 
@@ -252,8 +252,8 @@ namespace System.Linq
 
                     for (var i = count - 1; i >= 0; i--)
                     {
-                        Task<bool> moveNextTask = moveNextTasks[i];
-                        IAsyncEnumerator<TSource> enumerator = enumerators[i];
+                        var moveNextTask = moveNextTasks[i];
+                        var enumerator = enumerators[i];
 
                         try
                         {

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Repeat.cs

@@ -44,7 +44,7 @@ namespace System.Linq
             {
                 while (true)
                 {
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }
@@ -69,7 +69,7 @@ namespace System.Linq
             {
                 for (var i = 0; i < count; i++)
                 {
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }

+ 9 - 9
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Scan.cs

@@ -36,7 +36,7 @@ namespace System.Linq
                         yield break;
                     }
 
-                    TSource res = e.Current;
+                    var res = e.Current;
 
                     while (await e.MoveNextAsync())
                     {
@@ -67,9 +67,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TAccumulate> Core(CancellationToken cancellationToken)
             {
-                TAccumulate res = seed;
+                var res = seed;
 
-                await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     res = accumulator(res, item);
 
@@ -102,7 +102,7 @@ namespace System.Linq
                         yield break;
                     }
 
-                    TSource res = e.Current;
+                    var res = e.Current;
 
                     while (await e.MoveNextAsync())
                     {
@@ -143,7 +143,7 @@ namespace System.Linq
                         yield break;
                     }
 
-                    TSource res = e.Current;
+                    var res = e.Current;
 
                     while (await e.MoveNextAsync())
                     {
@@ -175,9 +175,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TAccumulate> Core(CancellationToken cancellationToken)
             {
-                TAccumulate res = seed;
+                var res = seed;
 
-                await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     res = await accumulator(res, item).ConfigureAwait(false);
 
@@ -202,9 +202,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TAccumulate> Core(CancellationToken cancellationToken)
             {
-                TAccumulate res = seed;
+                var res = seed;
 
-                await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     res = await accumulator(res, item, cancellationToken).ConfigureAwait(false);
 

+ 6 - 6
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Using.cs

@@ -25,9 +25,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                using (TResource resource = resourceFactory())
+                using (var resource = resourceFactory())
                 {
-                    await foreach (TSource item in enumerableFactory(resource).WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in enumerableFactory(resource).WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }
@@ -50,9 +50,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                using (TResource resource = await resourceFactory().ConfigureAwait(false))
+                using (var resource = await resourceFactory().ConfigureAwait(false))
                 {
-                    await foreach (TSource item in (await enumerableFactory(resource).ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in (await enumerableFactory(resource).ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }
@@ -76,9 +76,9 @@ namespace System.Linq
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
             {
-                using (TResource resource = await resourceFactory(cancellationToken).ConfigureAwait(false))
+                using (var resource = await resourceFactory(cancellationToken).ConfigureAwait(false))
                 {
-                    await foreach (TSource item in (await enumerableFactory(resource, cancellationToken).ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in (await enumerableFactory(resource, cancellationToken).ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         yield return item;
                     }

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerableHelpers.cs

@@ -112,7 +112,7 @@ namespace System.Collections.Generic
         {
             var set = new Set<T>(comparer);
 
-            await foreach (T item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 set.Add(item);
             }

+ 6 - 6
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs

@@ -133,7 +133,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = _accumulator(acc, item);
                 }
@@ -155,7 +155,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item).ConfigureAwait(false);
                 }
@@ -178,7 +178,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item, _cancellationToken).ConfigureAwait(false);
                 }
@@ -203,7 +203,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = _accumulator(acc, item);
                 }
@@ -227,7 +227,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item).ConfigureAwait(false);
                 }
@@ -252,7 +252,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item, _cancellationToken).ConfigureAwait(false);
                 }

+ 3 - 3
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs

@@ -21,7 +21,7 @@ namespace System.Linq
 
             static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, bool> _predicate, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!_predicate(item))
                     {
@@ -44,7 +44,7 @@ namespace System.Linq
 
             static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await _predicate(item).ConfigureAwait(false))
                     {
@@ -68,7 +68,7 @@ namespace System.Linq
 
             static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await _predicate(item, _cancellationToken).ConfigureAwait(false))
                     {

+ 3 - 3
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs

@@ -43,7 +43,7 @@ namespace System.Linq
 
             static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, bool> _predicate, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (_predicate(item))
                     {
@@ -66,7 +66,7 @@ namespace System.Linq
 
             static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item).ConfigureAwait(false))
                     {
@@ -90,7 +90,7 @@ namespace System.Linq
 
             static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item, _cancellationToken).ConfigureAwait(false))
                     {

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs

@@ -206,7 +206,7 @@ namespace System.Linq
                 }
                 else
                 {
-                    await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         array[index] = item;
                         ++index;
@@ -234,7 +234,7 @@ namespace System.Linq
                     list.Add(_item);
                 }
 
-                await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     list.Add(item);
                 }
@@ -395,7 +395,7 @@ namespace System.Linq
                 }
                 else
                 {
-                    await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         array[index] = item;
                         ++index;
@@ -421,7 +421,7 @@ namespace System.Linq
                     list.Add(n.Item);
                 }
 
-                await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     list.Add(item);
                 }

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs

@@ -84,7 +84,7 @@ namespace System.Linq
                         break;
                     }
 
-                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         list.Add(item);
                     }

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

@@ -28,7 +28,7 @@ namespace System.Linq
 
                 static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, TSource _value, CancellationToken _cancellationToken)
                 {
-                    await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         if (EqualityComparer<TSource>.Default.Equals(item, _value))
                         {
@@ -45,7 +45,7 @@ namespace System.Linq
 
                 static async ValueTask<bool> Core(IAsyncEnumerable<TSource> _source, TSource _value, IEqualityComparer<TSource> _comparer, CancellationToken _cancellationToken)
                 {
-                    await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         if (_comparer.Equals(item, _value))
                         {

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs

@@ -32,7 +32,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
                     {
@@ -57,7 +57,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (_predicate(item))
                     {
@@ -85,7 +85,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item).ConfigureAwait(false))
                     {
@@ -114,7 +114,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item, _cancellationToken).ConfigureAwait(false))
                     {

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs

@@ -37,7 +37,7 @@ namespace System.Linq
 
                     if (_index >= 0)
                     {
-                        await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                        await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                         {
                             if (_index == 0)
                             {

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs

@@ -40,7 +40,7 @@ namespace System.Linq
                     }
                     else
                     {
-                        await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                        await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                         {
                             if (_index == 0)
                             {

+ 6 - 6
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs

@@ -28,7 +28,7 @@ namespace System.Linq
 
             static async Task Core(IAsyncEnumerable<TSource> _source, Action<TSource> _action, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     _action(item);
                 }
@@ -48,7 +48,7 @@ namespace System.Linq
             {
                 var index = 0;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     _action(item, checked(index++));
                 }
@@ -66,7 +66,7 @@ namespace System.Linq
 
             static async Task Core(IAsyncEnumerable<TSource> _source, Func<TSource, Task> _action, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item).ConfigureAwait(false);
                 }
@@ -79,7 +79,7 @@ namespace System.Linq
 
             static async Task Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, Task> _action, CancellationToken _cancellationToken)
             {
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item, _cancellationToken).ConfigureAwait(false);
                 }
@@ -99,7 +99,7 @@ namespace System.Linq
             {
                 var index = 0;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item, checked(index++)).ConfigureAwait(false);
                 }
@@ -119,7 +119,7 @@ namespace System.Linq
             {
                 var index = 0;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item, checked(index++), _cancellationToken).ConfigureAwait(false);
                 }

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs

@@ -101,7 +101,7 @@ namespace System.Linq
                     var last = default(TSource);
                     var hasLast = false;
 
-                    await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         hasLast = true;
                         last = item;
@@ -119,7 +119,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-            await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 if (predicate(item))
                 {
@@ -136,7 +136,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-            await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 if (await predicate(item).ConfigureAwait(false))
                 {
@@ -154,7 +154,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-            await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 if (await predicate(item, cancellationToken).ConfigureAwait(false))
                 {

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
                     {
@@ -46,7 +46,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (_predicate(item))
                     {
@@ -74,7 +74,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item).ConfigureAwait(false))
                     {
@@ -103,7 +103,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item, _cancellationToken).ConfigureAwait(false))
                     {

+ 9 - 9
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Lookup.cs

@@ -91,7 +91,7 @@ namespace System.Linq.Internal
 
             var lookup = new Lookup<TKey, TElement>(comparer);
 
-            await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = keySelector(item);
                 var group = lookup.GetGrouping(key, create: true);
@@ -110,7 +110,7 @@ namespace System.Linq.Internal
 
             var lookup = new Lookup<TKey, TElement>(comparer);
 
-            await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = keySelector(item);
                 lookup.GetGrouping(key, create: true).Add(item);
@@ -123,7 +123,7 @@ namespace System.Linq.Internal
         {
             var lookup = new Lookup<TKey, TElement>(comparer);
 
-            await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = keySelector(item);
                 if (key != null)
@@ -356,7 +356,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-            await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item).ConfigureAwait(false);
                 var group = lookup.GetGrouping(key, create: true);
@@ -377,7 +377,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-            await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item, cancellationToken).ConfigureAwait(false);
                 var group = lookup.GetGrouping(key, create: true);
@@ -397,7 +397,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-            await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item).ConfigureAwait(false);
                 lookup.GetGrouping(key, create: true).Add(item);
@@ -414,7 +414,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-            await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item, cancellationToken).ConfigureAwait(false);
                 lookup.GetGrouping(key, create: true).Add(item);
@@ -428,7 +428,7 @@ namespace System.Linq.Internal
         {
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-            await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item).ConfigureAwait(false);
                 if (key != null)
@@ -445,7 +445,7 @@ namespace System.Linq.Internal
         {
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-            await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+            await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item, cancellationToken).ConfigureAwait(false);
                 if (key != null)

+ 6 - 6
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs

@@ -273,15 +273,15 @@ namespace System.Linq
                     return new Maybe<TElement>();
                 }
 
-                TElement value = e.Current;
+                var value = e.Current;
 
-                AsyncCachingComparer<TElement> comparer = GetComparer();
+                var comparer = GetComparer();
 
                 await comparer.SetElement(value, cancellationToken).ConfigureAwait(false);
 
                 while (await e.MoveNextAsync())
                 {
-                    TElement x = e.Current;
+                    var x = e.Current;
 
                     if (await comparer.Compare(x, cacheLower: true, cancellationToken).ConfigureAwait(false) < 0)
                     {
@@ -308,15 +308,15 @@ namespace System.Linq
                     return new Maybe<TElement>();
                 }
 
-                TElement value = e.Current;
+                var value = e.Current;
 
-                AsyncCachingComparer<TElement> comparer = GetComparer();
+                var comparer = GetComparer();
 
                 await comparer.SetElement(value, cancellationToken).ConfigureAwait(false);
 
                 while (await e.MoveNextAsync())
                 {
-                    TElement current = e.Current;
+                    var current = e.Current;
 
                     if (await comparer.Compare(current, cacheLower: false, cancellationToken).ConfigureAwait(false) >= 0)
                     {

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

@@ -34,9 +34,9 @@ namespace System.Linq
 
                 if (firstCol is IList<TSource> firstList && secondCol is IList<TSource> secondList)
                 {
-                    int count = firstCol.Count;
+                    var count = firstCol.Count;
 
-                    for (int i = 0; i < count; i++)
+                    for (var i = 0; i < count; i++)
                     {
                         if (!comparer.Equals(firstList[i], secondList[i]))
                         {

+ 6 - 6
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs

@@ -26,7 +26,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TSource>(_comparer);
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = _keySelector(item);
 
@@ -53,7 +53,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TSource>(_comparer);
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item).ConfigureAwait(false);
 
@@ -81,7 +81,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TSource>(_comparer);
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item, _cancellationToken).ConfigureAwait(false);
 
@@ -111,7 +111,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TElement>(_comparer);
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = _keySelector(item);
                     var value = _elementSelector(item);
@@ -141,7 +141,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TElement>(_comparer);
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item).ConfigureAwait(false);
                     var value = await _elementSelector(item).ConfigureAwait(false);
@@ -172,7 +172,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TElement>(_comparer);
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item, _cancellationToken).ConfigureAwait(false);
                     var value = await _elementSelector(item, _cancellationToken).ConfigureAwait(false);

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs

@@ -24,7 +24,7 @@ namespace System.Linq
             {
                 var set = new HashSet<TSource>(_comparer);
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     set.Add(item);
                 }

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs

@@ -24,7 +24,7 @@ namespace System.Linq
             {
                 var list = new List<TSource>();
 
-                await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
+                await foreach (var item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     list.Add(item);
                 }

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs

@@ -162,7 +162,7 @@ namespace System.Linq
                         return set;
                     }
 
-                    await foreach (TSource item in enumerable.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    await foreach (var item in enumerable.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         set.Add(item);
                     }