Files
swift-collections/Sources
inju2403 7a67033ee2 [OrderedCollections] Use exchange(_:with:) in replaceElement's equal-key path
#688 factored `replaceElement`'s general case onto `OrderedSet._replaceNew(at:with:in:)` and, per review feedback, switched the value overwrite there to `exchange(_:with:)`. The equal-key path above it was outside that diff, so it still reads the old value into a local and then assigns over it.

Switch it to `exchange(_:with:)` as well, so both paths move the old value out instead of copying it. No behavior change: the returned element, the preconditions, and the expected amortized O(1) complexity are all unchanged.
2026-08-14 09:19:43 +09:00
..
2026-07-07 14:21:53 -07:00