From 39cf3780e5666ab2c95ed0552b67ef1680c5f7a4 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 14 Jan 2016 02:15:00 +0000 Subject: [PATCH] hash.c: trivial optimization * hash.c (rb_hash_initialize_copy): trivial optimization, copy HASH_PROC_DEFAULT bit directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hash.c b/hash.c index b06d651343..81a5e6b024 100644 --- a/hash.c +++ b/hash.c @@ -1573,12 +1573,8 @@ rb_hash_initialize_copy(VALUE hash, VALUE hash2) st_clear(ntbl); } - if (FL_TEST(hash2, HASH_PROC_DEFAULT)) { - FL_SET(hash, HASH_PROC_DEFAULT); - } - else { - FL_UNSET(hash, HASH_PROC_DEFAULT); - } + FL_UNSET_RAW(hash, HASH_PROC_DEFAULT); + FL_SET_RAW(hash, FL_TEST_RAW(hash2, HASH_PROC_DEFAULT)); RHASH_SET_IFNONE(hash, RHASH_IFNONE(hash2)); return hash;