diff options
author | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-12 02:22:01 +0000 |
---|---|---|
committer | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-12 02:22:01 +0000 |
commit | b9a9a024094026ee5151de237c4d2ae8111ddc03 (patch) | |
tree | 84d963267b3d2a2fa89ab3124b9e9eeb4fb9b727 /hash.c | |
parent | 7a171aa8d1b2c482ab2957da2f8901e64db0082a (diff) | |
download | ruby-b9a9a024094026ee5151de237c4d2ae8111ddc03.tar.gz |
* hash.c (recursive_hash): use RHASH_SIZE() to check hash size.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1869,12 +1869,9 @@ hash_i(VALUE key, VALUE val, VALUE arg) static VALUE recursive_hash(VALUE hash, VALUE dummy, int recur) { - st_index_t hval; + st_index_t hval = RHASH_SIZE(hash); - if (!RHASH(hash)->ntbl) - return LONG2FIX(0); - hval = RHASH(hash)->ntbl->num_entries; - if (!hval) return LONG2FIX(0); + if (!hval) return INT2FIX(0); if (recur) hval = rb_hash_uint(rb_hash_start(rb_hash(rb_cHash)), hval); else |