mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
_resizingShiftRight(by:) copied the surviving suffix down to index 0 and then removed `count &- amount` trailing bits instead of `amount`, so it truncated the result to `amount` stale bits rather than keeping `count - amount` valid ones. resizingShiftLeft(by: -n) was affected via the same path, and the API had no test coverage at all. Also fix the doc examples, which demonstrated the resizing shifts with the masking shift function names (and, in one case, a result whose bit count contradicted the documented growth by `amount`). Add regression tests asserting parity with the documented semantics (dropFirst / prepending false values) across word-boundary counts, negative amounts, boundary `amount` values, and the doc examples verbatim.