aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--array.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 17d42f6804..7449138971 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 18 23:45:06 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_eql): compare RARRAY_PTR() for performance
+ improvement in case of that self and other are shared.
+
Thu Jul 18 22:46:42 2013 Zachary Scott <e@zzak.io>
* lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]
diff --git a/array.c b/array.c
index f145bc8d8d..d9488fc46e 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);
}