You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jruby 9.3.0.0-SNAPSHOT (2.5.0) 2018-01-08 4b5cea6 OpenJDK 64-Bit Server VM 25.151-b12 on 1.8.0_151-b12 +jit [linux-x86_64]
Expected Behavior
When rehashing a hash with equal objects in it, they don't get removed.
a = [1,2]
b = [1]
h = {}
h[a] = true
h[b] = true
b << 2
puts h.rehash # { [1,2]: true, [1,2]: true }
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:
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: