diff options
author | Marc-Andre Lafortune <[email protected]> | 2021-03-15 22:15:03 -0400 |
---|---|---|
committer | Marc-Andre Lafortune <[email protected]> | 2021-03-18 07:34:40 -0400 |
commit | 0ef2923c2b9afb76b3a1cebc56ebabc71c9a2ba8 (patch) | |
tree | a5572db3a246e53e1293823249e8ad4413ef061b /hash.c | |
parent | d094c3ef046aba0bb99fd08bcbc72ff87216e736 (diff) |
Avoid rehashing in Hash#replace/dup/initialize_copy [Bug #16996]
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2958,7 +2958,7 @@ rb_hash_replace(VALUE hash, VALUE hash2) RHASH_TBL_RAW(hash)->type = RHASH_ST_TABLE(hash2)->type; } } - rb_hash_foreach(hash2, rb_hash_rehash_i, (VALUE)hash); + hash_copy(hash, hash2); rb_gc_writebarrier_remember(hash); |