Actions
Bug #9231
closedThe value of [].hash is equal to the value of false.hash
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-12-09 trunk 44080) [x64-mswin64_120]
Backport:
Description
I found that [].hash == false.hash.
And the combinations of each elements also have the same value.
Is this an intended behavior?
C:\Users\phasis>irb
irb(main):001:0> [].hash
=> 1336528015
irb(main):002:0> false.hash
=> 1336528015
irb(main):003:0> [false,false].hash
=> -1570892633
irb(main):004:0> [false,[]].hash
=> -1570892633
irb(main):005:0> [[],false].hash
=> -1570892633
irb(main):006:0> [[],[]].hash
=> -1570892633
irb(main):008:0> {false=>false}.hash
=> -539662806
irb(main):009:0> {[]=>[]}.hash
=> -539662806
irb(main):010:0> {[]=>false}.hash
=> -539662806
irb(main):011:0> {false=>[]}.hash
=> -539662806
Actions
Like0
Like0