summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-02 03:03:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-02 03:03:18 +0000
commit0d6ef941111de72baf4e880cbc7a5862a5406e91 (patch)
treeaf79c275af13675b884839ad8a4396fd396ad0dd /hash.c
parentceb5e60c812c9c002db21043b3e1b0ae87bf28e0 (diff)
* hash.c (recursive_hash): hash value of emptied hash should be
equal to an empty hash. [ruby-core:38650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 8d6cd96ded..fbd82374eb 100644
--- a/hash.c
+++ b/hash.c
@@ -1685,6 +1685,7 @@ recursive_hash(VALUE hash, VALUE dummy, int recur)
if (!RHASH(hash)->ntbl)
return LONG2FIX(0);
hval = RHASH(hash)->ntbl->num_entries;
+ if (!hval) return LONG2FIX(0);
if (recur)
hval = rb_hash_uint(rb_hash_start(rb_hash(rb_cHash)), hval);
else