summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
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;
}