Skip to content

Commit

Permalink
Merge pull request #906 from dotnet/MiscCleanup
Browse files Browse the repository at this point in the history
Some minor cleanup
  • Loading branch information
bartdesmet authored May 24, 2019
2 parents 447c3fb + 5deb0f1 commit ad58020
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ public ValueTask<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancella

return Core(cancellationToken);

async ValueTask<int> Core(CancellationToken _cancellationToken)
async ValueTask<int> Core(CancellationToken cancellationToken)
{
var count = 0;

await foreach (var element in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
await foreach (var element in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
{
checked
{
Expand Down Expand Up @@ -503,11 +503,11 @@ public ValueTask<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancella

return Core(cancellationToken);

async ValueTask<int> Core(CancellationToken _cancellationToken)
async ValueTask<int> Core(CancellationToken cancellationToken)
{
var count = 0;

await foreach (var element in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
await foreach (var element in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
{
var items = await _selector(element).ConfigureAwait(false);

Expand Down Expand Up @@ -645,13 +645,13 @@ public ValueTask<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancella

return Core(cancellationToken);

async ValueTask<int> Core(CancellationToken _cancellationToken)
async ValueTask<int> Core(CancellationToken cancellationToken)
{
var count = 0;

await foreach (var element in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
await foreach (var element in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
{
var items = await _selector(element, _cancellationToken).ConfigureAwait(false);
var items = await _selector(element, cancellationToken).ConfigureAwait(false);

checked
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ public static ValueTask<bool> SequenceEqualAsync<TSource>(this IAsyncEnumerable<
if (second == null)
throw Error.ArgumentNull(nameof(second));

if (comparer == null)
{
comparer = EqualityComparer<TSource>.Default;
}
comparer ??= EqualityComparer<TSource>.Default;

if (first is ICollection<TSource> firstCol && second is ICollection<TSource> secondCol)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

Expand Down

0 comments on commit ad58020

Please sign in to comment.