summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-12 02:22:01 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-12 02:22:01 +0000
commitb9a9a024094026ee5151de237c4d2ae8111ddc03 (patch)
tree84d963267b3d2a2fa89ab3124b9e9eeb4fb9b727
parent7a171aa8d1b2c482ab2957da2f8901e64db0082a (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--hash.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 262ddc7c350..2f692f2651b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jul 12 11:17:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (recursive_hash): use RHASH_SIZE() to check hash size.
+
Fri Jul 12 00:20:00 2013 Masaki Matsushita <glass.saga@gmail.com>
* hash.c (rb_hash_size): use RHASH_SIZE().
diff --git a/hash.c b/hash.c
index 7997b2e6813..95fea9e96da 100644
--- a/hash.c
+++ b/hash.c
@@ -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