Skip to content

v3.2.0

Latest

Choose a tag to compare

@elliotchance elliotchance released this 24 Nov 16:18
· 1 commit to master since this release
a7bca18
Add Swap method to OrderedMap (#66)

Swap(key1, key2) exchanges the positions of two elements in constant
time by relinking them in the list, so values and the key lookup are
untouched. It returns false if either key does not exist, and true when
both keys are the same, which leaves the map unchanged.

Swapping is by key rather than by index because the map has no
positional access.

Added to v1, v2 and v3, with tests and benchmarks.

Fixes #59

Signed-off-by: AdamMagued <adamismailmageud@gmail.com>