summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 14:47:27 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 14:47:27 +0000
commit2de786d43756dc16ee43e5a8b280fec6f6cfc589 (patch)
treedf3b2dc4170e027d07ff12ba0f81394c7e6f06b1 /array.c
parentc366a99cc539d9a963cbaac8040e988699609026 (diff)
* array.c (rb_ary_eql): 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@42046 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 f145bc8..d9488fc 100644
--- a/array.c
+++ b/array.c
@@ -3668,6 +3668,7 @@ rb_ary_eql(VALUE ary1, VALUE ary2)
if (ary1 == ary2) return Qtrue;
if (!RB_TYPE_P(ary2, T_ARRAY)) return Qfalse;
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
+ if (RARRAY_PTR(ary1) == RARRAY_PTR(ary2)) return Qtrue;
return rb_exec_recursive_paired(recursive_eql, ary1, ary2, ary2);
}