-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix HashSet::get_or_insert_with
#400
base: master
Are you sure you want to change the base?
Fix HashSet::get_or_insert_with
#400
Conversation
836fbed
to
7f88093
Compare
Should an |
Well, strictly speaking, rehashing was present in the old version of the code. Only two comparisons and a panic were added here. Let's see what @Amanieu says :-). In theory, as I understand it, there is nothing that violates memory or causes UB in the fact that there are two or more identical elements in a Hashmap or HashSet. It just increases the collision, the elements after the first one will be lost and will only show up when iterating. The documentation for |
☔ The latest upstream changes (presumably #390) made this pull request unmergeable. Please resolve the merge conflicts. |
bc0a170
to
db83742
Compare
db83742
to
63c2dc5
Compare
☔ The latest upstream changes (presumably #533) made this pull request unmergeable. Please resolve the merge conflicts. |
Co-authored-by: JustForFun88 <alishergaliev88@gmail.com>
Co-authored-by: JustForFun88 <alishergaliev88@gmail.com>
Co-authored-by: JustForFun88 <alishergaliev88@gmail.com>
Fix #399. Tried to do it without additional overhead. Unless there are additional comparisons.