From 73fdc38bc2fa536afd405d023b5d568488556db0 Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 20 Jun 2009 09:06:35 +0000 Subject: 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 4c78122a0..d34604bec 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); } /* -- cgit