-
Notifications
You must be signed in to change notification settings - Fork 152
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
Change remove
to unstable_remove
#241
Comments
IMO, The |
Okay, I see this has already been discussed. I had searched for issues, but I didn't think there would be a discussion about this directly in a PR 😥. I will give my opinion, just in case it is useful: I agree with @/Mark-Simulacrum here and with you here. I feel like it is a bigger footgun not to have the expected behavior than to have worse performance. I get the argument about the deprecation kinda defeating the purpose of indexmap being a drop-in replacement. IMO it would be acceptable to have a worse perf when adding it as a drop-in and being able to improve performance if necessary after (by changing Anyway, if this has already been discussed, it will be okay if you just close this issue! |
Note that @bluss, has time altered your opinion about this? |
Hmmm I didn't know that. I guess that using it as a drop-in it would be more common to want to want to preserve the order than the indexes, but I may be biased in this opinion |
Upvoting for a (re-)deprecation of the Or |
The actual name of
remove
isn't clear enough about the consequences of using it. As can be seen in rust-lang/rust#102674. It can lead to confusion, thinking that even when callingremove
the order will still be kept.It could be changed to
unstable_remove
orunstable_swap_remove
to made clear that the insertion order will be disrupted.shift_remove
could also be renamed toremove
if deemed desirable.I find it is better to have worse performance, than a bug. The performance can be improved if needed, but a bug can be difficult to find.
The text was updated successfully, but these errors were encountered: