summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 12:21:51 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 12:21:51 +0000
commit4595d9a3c98bfc759f4c3361adb20a9213ec610c (patch)
treee3211f1e05ce613e92d15cb9ae0fb585dd9047cf /array.c
parente07e814ec3c732337153a71eb5718431d8e28a99 (diff)
* array.c (rb_ary_equal): compare RARRAY_PTR() for performance
improvement in case of that self and other are shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/array.c b/array.c
index d2b45d9..f145bc8 100644
--- a/array.c
+++ b/array.c
@@ -3637,6 +3637,7 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
return rb_equal(ary2, ary1);
}
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
+ if (RARRAY_PTR(ary1) == RARRAY_PTR(ary2)) return Qtrue;
return rb_exec_recursive_paired(recursive_equal, ary1, ary2, ary2);
}