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

ruby-changes:48159

From: hsbt <ko1@a...>
Date: Sat, 21 Oct 2017 22:40:16 +0900 (JST)
Subject: [ruby-changes:48159] hsbt:r60273 (trunk): Added sample code of merge! method in hash.c.

hsbt	2017-10-21 22:40:12 +0900 (Sat, 21 Oct 2017)

  New Revision: 60273

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

  Log:
    Added sample code of merge! method in hash.c.
    
      https://github.com/ruby/ruby/pull/1652
    
      Patch by @selmertsx [fix GH-1652]

  Modified files:
    trunk/hash.c
Index: hash.c
===================================================================
--- hash.c	(revision 60272)
+++ hash.c	(revision 60273)
@@ -2530,11 +2530,13 @@ rb_hash_update_block_i(VALUE key, VALUE https://github.com/ruby/ruby/blob/trunk/hash.c#L2530
  *     h1 = { "a" => 100, "b" => 200 }
  *     h2 = { "b" => 254, "c" => 300 }
  *     h1.merge!(h2)   #=> {"a"=>100, "b"=>254, "c"=>300}
+ *     h1              #=> {"a"=>100, "b"=>254, "c"=>300}
  *
  *     h1 = { "a" => 100, "b" => 200 }
  *     h2 = { "b" => 254, "c" => 300 }
  *     h1.merge!(h2) { |key, v1, v2| v1 }
  *                     #=> {"a"=>100, "b"=>200, "c"=>300}
+ *     h1              #=> {"a"=>100, "b"=>200, "c"=>300}
  */
 
 static VALUE

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

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