diff --git a/release-notes.txt b/release-notes.txt index 7078840..9fb0961 100644 --- a/release-notes.txt +++ b/release-notes.txt @@ -2,6 +2,7 @@ Release notes: 1.0.0 + - perf: TaskSeq.chunkBy and chunkByAsync reuse the ResizeArray buffer between chunks, reducing allocations on sequences with many chunk boundaries - fixes: TaskSeq.insertAt, insertManyAt, removeAt, removeManyAt, updateAt now raise ArgumentNullException (not NullReferenceException) when given a null source; insertManyAt also validates the values argument - refactor: simplify lengthBy and lengthBeforeMax to use while! and remove the redundant mutable 'go' and initial MoveNextAsync - adds TaskSeq.distinctUntilChangedWith and TaskSeq.distinctUntilChangedWithAsync, #345 diff --git a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs index cc279c1..261dbba 100644 --- a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs +++ b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs @@ -1754,7 +1754,7 @@ module internal TaskSeqInternal = currentChunk.Add item else yield prevKey, currentChunk.ToArray() - currentChunk <- ResizeArray<'T>() + currentChunk.Clear() // reuse backing array; ToArray() already captured a snapshot currentChunk.Add item maybeCurrentKey <- ValueSome key @@ -1782,7 +1782,7 @@ module internal TaskSeqInternal = currentChunk.Add item else yield prevKey, currentChunk.ToArray() - currentChunk <- ResizeArray<'T>() + currentChunk.Clear() // reuse backing array; ToArray() already captured a snapshot currentChunk.Add item maybeCurrentKey <- ValueSome key