Skip to content

Commit

Permalink
Revert "add bug: reuse same array; no test fails"
Browse files Browse the repository at this point in the history
This reverts commit 2977c3b.
  • Loading branch information
leandromoh committed Jun 13, 2021
1 parent 8388c2c commit 23f8c33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MoreLinq/Batch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static IEnumerable<TResult> Batch<TSource, TResult>(this IEnumerable<TSou

IEnumerable<TResult> Batch(int size)
{
TSource[]? bucket = new TSource[size];
TSource[]? bucket = null;
var count = 0;

foreach (var item in source)
Expand All @@ -139,6 +139,7 @@ IEnumerable<TResult> Batch(int size)

yield return resultSelector(bucket);

bucket = null;
count = 0;
}

Expand Down

0 comments on commit 23f8c33

Please sign in to comment.