summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-02-02 14:43:30 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-02-02 14:43:50 -0500
commit5b34839b0f9d164552f8da41b6ced2db1d2af3be (patch)
treea8775a23437c0745936c8eb2cbe00c518b6b2488 /hash.c
parent65ca14ea6e12d2e0bf2aff60538c8ca291c65fd3 (diff)
downloadruby-5b34839b0f9d164552f8da41b6ced2db1d2af3be.tar.gz
Remove redundant else if statement in hash.c
Hashes can only be ar or st, so the else if is redundant.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 4 insertions, 2 deletions
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;
}