ruby-changes:31393
From: glass <ko1@a...>
Date: Wed, 30 Oct 2013 12:11:50 +0900 (JST)
Subject: [ruby-changes:31393] glass:r43472 (trunk): * array.c (rb_ary_uniq_bang): use rb_ary_modify_check() instead of
glass 2013-10-30 12:11:41 +0900 (Wed, 30 Oct 2013) New Revision: 43472 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43472 Log: * array.c (rb_ary_uniq_bang): use rb_ary_modify_check() instead of rb_ary_modify() because the array will be unshared soon. Modified files: trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 43471) +++ array.c (revision 43472) @@ -4111,7 +4111,7 @@ rb_ary_uniq_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L4111 if (RARRAY_LEN(ary) == hash_size) { return Qnil; } - rb_ary_modify(ary); + rb_ary_modify_check(ary); ARY_SET_LEN(ary, 0); if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) { rb_ary_unshare(ary); @@ -4126,7 +4126,7 @@ rb_ary_uniq_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L4126 if (RARRAY_LEN(ary) == hash_size) { return Qnil; } - rb_ary_modify(ary); + rb_ary_modify_check(ary); ARY_SET_LEN(ary, 0); if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) { rb_ary_unshare(ary); Index: ChangeLog =================================================================== --- ChangeLog (revision 43471) +++ ChangeLog (revision 43472) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Oct 30 12:08:41 2013 Masaki Matsushita <glass.saga@g...> + + * array.c (rb_ary_uniq_bang): use rb_ary_modify_check() instead of + rb_ary_modify() because the array will be unshared soon. + Wed Oct 30 03:25:10 2013 Aaron Patterson <aaron@t...> * ext/psych/lib/psych/visitors/yaml_tree.rb: make less garbage when -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/