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 3ed5462fd3..33b8af84d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 18 21:15:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_equal): compare RARRAY_PTR() for performance
+ improvement in case of that self and other are shared.
+
Thu Jul 18 20:44:51 2013 Masaki Matsushita <glass.saga@gmail.com>
* array.c (rb_ary_fill): use memfill().
diff --git a/array.c b/array.c
index d2b45d9312..f145bc8d8d 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);
}