mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-25 04:27:47 +00:00
This could result in fewer comparisons. Additionally, it ensures that the insertion index is valid for insertion. The `removeLast()` documentation states: > Calling this method may invalidate all saved indices of this collection. Do not rely on a previously stored index value after altering a collection with any operation that can change its length.