When using the swap method between 2 elements of an array, the only way it works is by calling:
myArrayTome.swap(someKey, someValue) and it swaps the items at key someKey with the value someValue, but when trying to do myArrayTome.swap(someKey, someOtherKey) or myArrayTome.swap(someValue, someOtherValue) we start getting either exceptions or crashes.
Moreover, calling myValue.swap(someOtherValue) also crashes.
When using the
swapmethod between 2 elements of an array, the only way it works is by calling:myArrayTome.swap(someKey, someValue)and it swaps the items at keysomeKeywith the valuesomeValue, but when trying to domyArrayTome.swap(someKey, someOtherKey)ormyArrayTome.swap(someValue, someOtherValue)we start getting either exceptions or crashes.Moreover, calling
myValue.swap(someOtherValue)also crashes.