[前][次][番号順一覧][スレッド一覧]

ruby-changes:37045

From: ayumin <ko1@a...>
Date: Sun, 4 Jan 2015 00:00:47 +0900 (JST)
Subject: [ruby-changes:37045] ayumin:r49126 (trunk): * hash.c: fix docs for Hash#invert. [Bug #10612]

ayumin	2015-01-04 00:00:31 +0900 (Sun, 04 Jan 2015)

  New Revision: 49126

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49126

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

  Modified files:
    trunk/ChangeLog
    trunk/hash.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49125)
+++ ChangeLog	(revision 49126)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan  3 23:56:28 2015  Ayumu AIZAWA  <ayumu.aizawa@g...>
+
+	* hash.c: fix docs for Hash#invert. [ruby-core:66917] [Bug #10612]
+
 Sat Jan  3 19:52:12 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/intern.h (rb_str_new_literal): define on all
Index: hash.c
===================================================================
--- hash.c	(revision 49125)
+++ hash.c	(revision 49126)
@@ -2093,6 +2093,8 @@ rb_hash_invert_i(VALUE key, VALUE value, https://github.com/ruby/ruby/blob/trunk/hash.c#L2093
  *
  *  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"}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]