Project

General

Profile

Actions

Feature #4262

closed

{key=>val}.hash is always equal to {val=>key}.hash

Added by phasis68 (Heesob Park) almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
[ruby-core:34334]

Description

=begin
$ irb
irb(main):001:0> {1=>2}.hash
=> -381777873
irb(main):002:0> {2=>1}.hash
=> -381777873
irb(main):003:0> {123=>"abc"}.hash
=> 661749683
irb(main):004:0> {"abc"=>123}.hash
=> 661749683

This happens for Ruby 1.8.7 and 1.9.x.

It would be better to have different hash value for {key=>val} and {val=>key} .
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r30514.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0