You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: replace ref cells with mutable in singleton, collectSeq, takeWhileInclusive, takeWhileInclusiveAsync
Modernises 4 remaining functions that still used old-style ref cells
(! / := operators) to use mutable local variables instead. This eliminates
heap-allocated Ref<T> objects in these enumerators, reducing GC pressure.
- singleton: state ref 0 -> mutable state = 0
- collectSeq: state ref (CollectSeqState...) -> mutable state
- takeWhileInclusive: fin ref false -> mutable fin = false
- takeWhileInclusiveAsync: fin ref false -> mutable fin = false
All 402 tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
### 4.12.0
2
2
3
3
* Tests: Added tests for `mapiAsync`, `tryPickAsync`, `pickAsync`, and `groupByAsync` — these four async functions previously had no test coverage.
4
+
* Performance: Modernised `singleton`, `collectSeq`, `takeWhileInclusive`, and `takeWhileInclusiveAsync` to use `mutable` local variables instead of `ref` cells (`!`/`:=` operators). Eliminates heap-allocated `Ref<T>` objects in these enumerators, reducing GC pressure consistent with the improvements in 4.11.0.
4
5
* Added `AsyncSeq.tryFindBack` — returns the last element for which the predicate returns true, or `None` if no match. Mirrors `Array.tryFindBack` / `List.tryFindBack`.
5
6
* Added `AsyncSeq.tryFindBackAsync` — async-predicate variant of `tryFindBack`.
6
7
* Added `AsyncSeq.findBack` — returns the last element for which the predicate returns true; raises `KeyNotFoundException` if no match. Mirrors `Array.findBack` / `List.findBack`.
0 commit comments