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.
This commit is contained in:
parent
a86f798fc2
commit
9592bc7039
Notes:
git
2023-05-23 19:28:20 +00:00
5
hash.c
5
hash.c
@ -2933,11 +2933,6 @@ rb_hash_replace(VALUE hash, VALUE hash2)
|
|||||||
rb_gc_writebarrier_remember(hash);
|
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;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user