You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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>