From 5b34839b0f9d164552f8da41b6ced2db1d2af3be Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 2 Feb 2023 14:43:30 -0500 Subject: Remove redundant else if statement in hash.c Hashes can only be ar or st, so the else if is redundant. --- hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 6a448d4bf2..ac41e08cc8 100644 --- a/hash.c +++ b/hash.c @@ -1576,10 +1576,12 @@ static VALUE hash_copy(VALUE ret, VALUE hash) { if (!RHASH_EMPTY_P(hash)) { - if (RHASH_AR_TABLE_P(hash)) + if (RHASH_AR_TABLE_P(hash)) { ar_copy(ret, hash); - else if (RHASH_ST_TABLE_P(hash)) + } + else { RHASH_ST_TABLE_SET(ret, st_copy(RHASH_ST_TABLE(hash))); + } } return ret; } -- cgit v1.2.1