mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
The closure-based replaceSubrange overloads on RigidArray (and, through them, UniqueArray and the generic RangeReplaceableContainer overloads) returned subrange.lowerBound ..< subrange.lowerBound + newItemCount even when the initializer performed a short fill, so the returned range could cover old elements that were never replaced and extend past endIndex. Return the number of items actually initialized (span.count), matching insert(addingCount:at:initializingWith:). Fixes #772