Hash#rehash does not properly rehash #4958
Closed
Milestone
Comments
Merged
I looked at your impl, and it was fine except for a couple things:
I almost had a fix but I'm pulled away to finish something else. |
ChrisBr
added a commit
to ChrisBr/jruby
that referenced
this issue
Jan 9, 2018
Duplicate keys where just ignored before and inserted again. Fix jruby#4958.
ChrisBr
added a commit
to ChrisBr/jruby
that referenced
this issue
Jan 9, 2018
Duplicate keys where just ignored before and inserted again. Fix jruby#4958.
ChrisBr
added a commit
to ChrisBr/jruby
that referenced
this issue
Jan 10, 2018
Duplicate keys where just ignored before and inserted again. Fix jruby#4958.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Expected Behavior
When rehashing a hash with equal objects in it, they don't get removed.
I already looked into the issue and it seems that the problem is that Hash#rehash does not handle collisions properly. When two objects have the same hash / bucket number, they get inserted even if they are the same (see example).
Actual Behavior
Hash#rehash should remove the duplicate entries.
The text was updated successfully, but these errors were encountered: