aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 13:40:12 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 13:40:12 +0000
commita8f28e70eb27a9d15dabe81368f2fb21370fdf98 (patch)
tree8f3a18e4594540c32a3528f0a926886e80e1a293 /hash.c
parenta365728f7be720305467aae79776f9420beb0b80 (diff)
downloadruby-a8f28e70eb27a9d15dabe81368f2fb21370fdf98.tar.gz
Added sample code of merge! method in hash.c.
https://github.com/ruby/ruby/pull/1652 Patch by @selmertsx [fix GH-1652] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 6e9cda954d..c0f2252948 100644
--- a/hash.c
+++ b/hash.c
@@ -2530,11 +2530,13 @@ rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
* 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