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 <[email protected]>
Co-authored-by: JustForFun88 <[email protected]>
Co-authored-by: JustForFun88 <[email protected]>
Fix #399. Tried to do it without additional overhead. Unless there are additional comparisons.