diff --git a/ChangeLog b/ChangeLog index ca9c71f9af..2b5c7f0b85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Jan 3 23:56:28 2015 Ayumu AIZAWA + + * hash.c: fix docs for Hash#invert. [ruby-core:66917] [Bug #10612] + Sat Jan 3 19:52:12 2015 Nobuyoshi Nakada * include/ruby/intern.h (rb_str_new_literal): define on all diff --git a/hash.c b/hash.c index bd49a1dd92..d54ab8ada5 100644 --- a/hash.c +++ b/hash.c @@ -2093,6 +2093,8 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash) * * Returns a new hash created by using hsh's values as keys, and * the keys as values. + * If a key with the same value already exists in the hsh, then + * the last one defined will be used, the earlier value(s) will be discarded. * * h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 } * h.invert #=> {0=>"a", 100=>"m", 200=>"d", 300=>"y"}