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 calling remove the order will still be kept.
It could be changed to unstable_remove or unstable_swap_remove to made clear that the insertion order will be disrupted.
shift_remove could also be renamed to remove 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 actual name of
removeisn'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 callingremovethe order will still be kept.It could be changed to
unstable_removeorunstable_swap_removeto made clear that the insertion order will be disrupted.shift_removecould also be renamed toremoveif 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.