mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b55ff99891
commit
02fb261ec1
5 changed files with 87 additions and 26 deletions
4
hash.c
4
hash.c
|
@ -1451,7 +1451,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, dt);
|
||||
|
@ -1488,7 +1488,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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue