1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* array.c (rb_ary_uniq_bang): use rb_ary_modify_check() instead of

rb_ary_modify() because the array will be unshared soon.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
glass 2013-10-30 03:11:41 +00:00
parent 06c6dcee25
commit adcab6c1bb
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Wed Oct 30 12:08:41 2013 Masaki Matsushita <glass.saga@gmail.com>
* 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@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/yaml_tree.rb: make less garbage when

View file

@ -4111,7 +4111,7 @@ rb_ary_uniq_bang(VALUE ary)
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)
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);