diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-10 21:48:20 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-10 21:48:20 +0900 |
commit | 7693897a1153c83cb2bdc147552e2fa2aa47f0c7 (patch) | |
tree | 603bbad0c9f5dae7a0c000e6b16e391ce85489d8 | |
parent | 1b4d406e3a04032b6d01e92b6d184a16945c6ac3 (diff) | |
download | ruby-7693897a1153c83cb2bdc147552e2fa2aa47f0c7.tar.gz |
Reduced duplicate code
-rw-r--r-- | hash.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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; } |