mootable/hashmap

Allow set in LinkedHashMap to specify replace at end, rather than replace at beginning.

jackmoxley opened this issue · 1 comments

Allow set in LinkedHashMap to specify replace at end, rather than replace at beginning.

Let us say that we entered entries ["travel/newyork", "travel/washington", "travel/seattle", "travel/newyork"].
Now, we are still in newyork and triggering autocompletion in hopes of just reusing a fresh entry, the last "travel/newyork".
But in the autocompletion we'll see "travel/seattle" instead.
Because "travel/newyork" was a first entry, and the last entry doesn't change the linked hash map order. Which is now {"travel/newyork": 2, "travel/washington": 1, "travel/seattle": 1}.
Hence reversal needs to happen before we enter the data into the linked hash map.

This allows reversal to happen after.