mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
7cb5b7dd23
commit
39cf3780e5
1 changed files with 2 additions and 6 deletions
8
hash.c
8
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;
|
||||
|
|
Loading…
Reference in a new issue