pointfreeco / swift-identified-collections

A library of data structures for working with collections of identifiable elements in an ergonomic, performant way.
MIT License
539 stars 46 forks source link

Fix partition #9

Closed tgt closed 3 years ago

tgt commented 3 years ago

The partition implementation was swapping the values rather than calling through to OrderedArray's partition. This led to the invariant of the key equaling the id of the value being broken.

The test only uses two elements since I think partition is unstable and so using more elements would make checking equality of the collections more complex.