Skip to content

Commit

Permalink
Fix Hash#rehash for open addressing
Browse files Browse the repository at this point in the history
We used the old bins array to get the index instead of the new one.
This caused that the bins array was wrongly calculated if a
collisions occours and eventually did not found keys in the hash
anymore.

Fix jruby#5304
  • Loading branch information
ChrisBr committed Sep 1, 2018
1 parent 6dac9c8 commit fe56d98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyHash.java
Expand Up @@ -1182,7 +1182,7 @@ private void rehashOpenAddressing() {
}

bin = secondaryBucketIndex(bin, newBins.length);
index = bins[bin];
index = newBins[bin];
}

if (!exists) {
Expand Down

0 comments on commit fe56d98

Please sign in to comment.