Feature #6177 » patch.diff
array.c | ||
---|---|---|
recursive_equal(VALUE ary1, VALUE ary2, int recur)
|
||
{
|
||
long i;
|
||
VALUE *p1, *p2;
|
||
if (recur) return Qtrue; /* Subtle! */
|
||
for (i=0; i<RARRAY_LEN(ary1); i++) {
|
||
p1 = RARRAY_PTR(ary1);
|
||
p2 = RARRAY_PTR(ary2);
|
||
for (i = 0; i<RARRAY_LEN(ary1) && *p1 == *p2; i++) {
|
||
p1++;
|
||
p2++;
|
||
}
|
||
for (; i<RARRAY_LEN(ary1); i++) {
|
||
if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
|
||
return Qfalse;
|
||
}
|