mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
insert(addingCount:initializingWith:) batches elements through a temporary OutputSpan and loops while `remainder > 0`. When the `UnstableContainersPreview` trait is disabled, the span's `defer` handler moved elements out of the temporary buffer but never decremented `remainder`, so the loop spun forever whenever the initializer didn't fill every batch. Update `remainder` the same way the preview branch already does, and add a regression test (issue #774).