-
Notifications
You must be signed in to change notification settings - Fork 167
Expand removal options #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As we're talking about a new release, I realized that I was also sitting on these changes in a branch... |
Makes sense. The release is already pushed out, but there can be more releases 🙂 What kind of deprecation is intended? My first thought that it would be a "permanently" deprecated method, since one design guideline was drop-in compatibility with HashMap. So you can switch hashmap implementations easily, and with the warning you can realize you have a choice of removal option. I'm afraid the deprecation message will be annoying for those that don't mind the current behaviour? |
looks good to me (and adding shift removal is a good idea!) |
Yes, this makes sense to me. We have a similar situation on rayon
Maybe so, but it's an easy fix to use |
Thank you for adding this! tests/ directory has no mention of shift_remove 😅 and I'm adding a quickcheck test now for that reason. |
Indexmap 1.2 is released including this feature 🙂 |
This aims to make the performance tradeoffs explicit when removing items.
shift_remove
andshift_take
perform O(n) removal, likeVec::remove
swap_*
methods already perform likeVec::swap_remove
remove
andtake
methods, which currently swap, are deprecated in favor of explicitshift
/swap
methods.Fixes #90.