Skip to content

Commit 663613a

Browse files
author
zzak
committed
* hash.c (rb_hash_update): Revert documentation from r38672
See: ruby#228 (comment) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 98b1b38 commit 663613a

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Wed Jan 02 02:29:00 2012 Zachary Scott <[email protected]>
2+
3+
* hash.c (rb_hash_update): Revert documentation from r38672
4+
See: https://github.com/ruby/ruby/pull/228#issuecomment-11791013
5+
16
Wed Jan 02 02:16:00 2012 Zachary Scott <[email protected]>
27

38
* hash.c (rb_hash_update): Documentation for Hash#merge and shallow

hash.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,19 +1893,6 @@ rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
18931893
* h2 = { "b" => 254, "c" => 300 }
18941894
* h1.merge!(h2) { |key, v1, v2| v1 }
18951895
* #=> {"a"=>100, "b"=>200, "c"=>300}
1896-
*
1897-
* Note that this method creates a shallow copy of the value in _other_hash_.
1898-
* This means that when for example Array#select! is used on one of the values
1899-
* in _other_hash_ both the original object as well as the copy will be
1900-
* modified. This is illustrated in the following example:
1901-
*
1902-
* original = { "numbers" => [10, 20, 30] }
1903-
* copy = {}.merge(original)
1904-
*
1905-
* copy["numbers"].select! { |number| number <= 20 }
1906-
*
1907-
* puts copy # => { "numbers" => [10, 20] }
1908-
* puts original # => { "numbers" => [10, 20] }
19091896
*/
19101897

19111898
static VALUE

0 commit comments

Comments
 (0)