From 9592bc703922933c4196748a0e7221a53ad50b9b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 23 May 2023 14:11:54 -0400 Subject: [PATCH] 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. --- hash.c | 5 ----- 1 file changed, 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; }