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

ruby-changes:41454

From: nobu <ko1@a...>
Date: Thu, 14 Jan 2016 11:14:35 +0900 (JST)
Subject: [ruby-changes:41454] nobu:r53528 (trunk): hash.c: trivial optimization

nobu	2016-01-14 11:15:00 +0900 (Thu, 14 Jan 2016)

  New Revision: 53528

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53528

  Log:
    hash.c: trivial optimization
    
    * hash.c (rb_hash_initialize_copy): trivial optimization, copy
      HASH_PROC_DEFAULT bit directly.

  Modified files:
    trunk/hash.c
Index: hash.c
===================================================================
--- hash.c	(revision 53527)
+++ hash.c	(revision 53528)
@@ -1573,12 +1573,8 @@ rb_hash_initialize_copy(VALUE hash, VALU https://github.com/ruby/ruby/blob/trunk/hash.c#L1573
 	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;

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

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