Remove redundant else if statement in hash.c

Hashes can only be ar or st, so the else if is redundant.
This commit is contained in:
Peter Zhu 2023-02-02 14:43:30 -05:00
parent 65ca14ea6e
commit 5b34839b0f

6
hash.c
View file

@ -1576,11 +1576,13 @@ static VALUE
hash_copy(VALUE ret, VALUE hash) hash_copy(VALUE ret, VALUE hash)
{ {
if (!RHASH_EMPTY_P(hash)) { if (!RHASH_EMPTY_P(hash)) {
if (RHASH_AR_TABLE_P(hash)) if (RHASH_AR_TABLE_P(hash)) {
ar_copy(ret, hash); ar_copy(ret, hash);
else if (RHASH_ST_TABLE_P(hash)) }
else {
RHASH_ST_TABLE_SET(ret, st_copy(RHASH_ST_TABLE(hash))); RHASH_ST_TABLE_SET(ret, st_copy(RHASH_ST_TABLE(hash)));
} }
}
return ret; return ret;
} }