From 7693897a1153c83cb2bdc147552e2fa2aa47f0c7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 10 Jan 2020 21:48:20 +0900 Subject: Reduced duplicate code --- hash.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index f68eaaabd4..878f2b1790 100644 --- a/hash.c +++ b/hash.c @@ -1801,12 +1801,7 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass) tmp = rb_hash_s_try_convert(Qnil, argv[0]); if (!NIL_P(tmp)) { hash = hash_alloc(klass); - if (RHASH_AR_TABLE_P(tmp)) { - ar_copy(hash, tmp); - } - else { - RHASH_ST_TABLE_SET(hash, st_copy(RHASH_ST_TABLE(tmp))); - } + hash_copy(hash, tmp); return hash; } -- cgit v1.2.3