mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Force recycle intermediate collection in Hash#transform_keys! [Bug #17735]
* Force recycle intermediate hash * Force recycle intermediate array too https://github.com/ruby/ruby/pull/4329#issuecomment-808840718
This commit is contained in:
parent
9af57eeed6
commit
522d4cd32f
Notes:
git
2021-03-28 14:10:14 +09:00
Merged-By: nobu <nobu@ruby-lang.org>
1 changed files with 2 additions and 0 deletions
2
hash.c
2
hash.c
|
@ -3294,7 +3294,9 @@ rb_hash_transform_keys_bang(int argc, VALUE *argv, VALUE hash)
|
|||
rb_hash_aset(new_keys, new_key, Qnil);
|
||||
}
|
||||
rb_ary_clear(pairs);
|
||||
rb_gc_force_recycle(pairs);
|
||||
rb_hash_clear(new_keys);
|
||||
rb_gc_force_recycle(new_keys);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue