1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* hash.c: fix docs for Hash#invert. [ruby-core:66917] [Bug #10612]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ayumin 2015-01-03 15:00:31 +00:00
parent 1711e80cf1
commit 45ecc02716
2 changed files with 6 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Sat Jan 3 23:56:28 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
* hash.c: fix docs for Hash#invert. [ruby-core:66917] [Bug #10612]
Sat Jan 3 19:52:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/intern.h (rb_str_new_literal): define on all

2
hash.c
View file

@ -2093,6 +2093,8 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
*
* Returns a new hash created by using <i>hsh</i>'s values as keys, and
* the keys as values.
* If a key with the same value already exists in the <i>hsh</i>, 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"}