diff --git a/release-notes.txt b/release-notes.txt index cfe2d7d..f4155e7 100644 --- a/release-notes.txt +++ b/release-notes.txt @@ -8,6 +8,7 @@ Release notes: - 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 + - refactor: simplify tryTail inner loop to use while!, removing redundant mutable 'go' flag and initial MoveNextAsync - adds TaskSeq.distinctUntilChangedWith and TaskSeq.distinctUntilChangedWithAsync, #345 - adds TaskSeq.withCancellation, #167 - adds TaskSeq.replicateInfinite, replicateInfiniteAsync, replicateUntilNoneAsync, #345 diff --git a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs index b6f77a3..ed8e095 100644 --- a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs +++ b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs @@ -845,14 +845,8 @@ module internal TaskSeqInternal = | true -> return taskSeq { - let mutable go = true - let! step = e.MoveNextAsync() - go <- step - - while go do + while! e.MoveNextAsync() do yield e.Current - let! step = e.MoveNextAsync() - go <- step } |> Some }