diff options
author | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-12 02:35:16 +0000 |
---|---|---|
committer | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-12 02:35:16 +0000 |
commit | bc241235ac4d02638dfe56d2d87b8cb906400f9d (patch) | |
tree | 56a681dff299cf999b45b41890c970d8e96fdda4 /hash.c | |
parent | b9a9a024094026ee5151de237c4d2ae8111ddc03 (diff) | |
download | ruby-bc241235ac4d02638dfe56d2d87b8cb906400f9d.tar.gz |
* hash.c (rb_hash_reject_bang): do not call rb_hash_foreach() if RHash
has ntbl and it is empty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1061,9 +1061,8 @@ rb_hash_reject_bang(VALUE hash) RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size); rb_hash_modify(hash); - if (!RHASH(hash)->ntbl) - return Qnil; - n = RHASH(hash)->ntbl->num_entries; + n = RHASH_SIZE(hash); + if (!n) return Qnil; rb_hash_foreach(hash, delete_if_i, hash); if (n == RHASH(hash)->ntbl->num_entries) return Qnil; return hash; |