heapless
heapless copied to clipboard
WIP/RFC: shift_remove and friends
Per #557, I took a stab at implementing the shift_remove_* family of functions from upstream IndexMap. I'm sure there's better ways to do the things I did; there are some todo's around exactly how to do the fixup after removing from entries. I factored out the re-calculation logic from .retain, but recalculating everything is probably overly conservative.
Also, you may not even want these API functions. No worries if so! But if you're interested, I'm happy to make changes or re-do things.
The removal logic is still bad. I'm adding additional tests that verify that the map is fully internally consistent: every entry can be found, every index points to an entry consistent with the hash value, and the number of entries and non-empty indices is the same.