summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-05-23 14:11:54 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-05-23 15:27:56 -0400
commit9592bc703922933c4196748a0e7221a53ad50b9b (patch)
tree484b737e73ffd8a4c669bbd5451664c3c9983af6 /hash.c
parenta86f798fc2e979ea83ec55744f906b2a816c8681 (diff)
Remove dead code in rb_hash_replace
We now always copy the ST table, so we don't need to initialize the ST table of hash when hash2 is empty.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7846
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/hash.c b/hash.c
index 80ed64527d..bb356725b2 100644
--- a/hash.c
+++ b/hash.c
@@ -2933,11 +2933,6 @@ rb_hash_replace(VALUE hash, VALUE hash2)
rb_gc_writebarrier_remember(hash);
}
- if (RHASH_EMPTY_P(hash2) && RHASH_ST_TABLE_P(hash2)) {
- /* ident hash */
- hash_st_table_init(hash, RHASH_TYPE(hash2), 0);
- }
-
return hash;
}