summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-20 09:06:35 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-20 09:06:35 +0000
commit0ddc8305736610337d6c26b3cec2c767cc5a054c (patch)
treee3a9880f73be06acc8e852899f6caa3ac8575c5f /hash.c
parent7340277cfb06305590a62a505c49e63a491be20c (diff)
merges r23557 and r23563 from trunk into ruby_1_9_1.
-- * thread.c (rb_exec_recursive_paired): new function for proper handling of recursive arrays. [EXPERIMENTAL] [ruby-core:23402] * array.c (rb_ary_equal, rb_ary_eql, rb_ary_cmp): use above. * hash.c (hash_equal): ditto. -- * test/ruby/test_hash.rb (TestHash::test_equal2): recursive hashes are handled properly now. ref: [ruby-core:23402] * test/ruby/test_m17n.rb (TestM17N#test_sprintf_p): test fixed git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 4c78122a02..d34604bec5 100644
--- a/hash.c
+++ b/hash.c
@@ -1428,7 +1428,7 @@ recursive_eql(VALUE hash, VALUE dt, int recur)
{
struct equal_data *data;
- if (recur) return Qfalse;
+ if (recur) return Qtrue; /* Subtle! */
data = (struct equal_data*)dt;
data->result = Qtrue;
rb_hash_foreach(hash, eql_i, (st_data_t)data);
@@ -1465,7 +1465,7 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
data.tbl = RHASH(hash2)->ntbl;
data.eql = eql;
- return rb_exec_recursive(recursive_eql, hash1, (VALUE)&data);
+ return rb_exec_recursive_paired(recursive_eql, hash1, hash2, (VALUE)&data);
}
/*