[前][次][番号順一覧][スレッド一覧]

ruby-changes:59673

From: Nobuyoshi <ko1@a...>
Date: Sat, 11 Jan 2020 00:55:31 +0900 (JST)
Subject: [ruby-changes:59673] 7693897a11 (master): Reduced duplicate code

https://git.ruby-lang.org/ruby.git/commit/?id=7693897a11

From 7693897a1153c83cb2bdc147552e2fa2aa47f0c7 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 10 Jan 2020 21:48:20 +0900
Subject: Reduced duplicate code


diff --git a/hash.c b/hash.c
index f68eaaa..878f2b1 100644
--- a/hash.c
+++ b/hash.c
@@ -1801,12 +1801,7 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass) https://github.com/ruby/ruby/blob/trunk/hash.c#L1801
         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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]