[前][次][番号順一覧][スレッド一覧]

ruby-changes:29991

From: glass <ko1@a...>
Date: Thu, 18 Jul 2013 21:22:03 +0900 (JST)
Subject: [ruby-changes:29991] glass:r42043 (trunk): * array.c (rb_ary_equal): compare RARRAY_PTR() for performance

glass	2013-07-18 21:21:51 +0900 (Thu, 18 Jul 2013)

  New Revision: 42043

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42043

  Log:
    * array.c (rb_ary_equal): compare RARRAY_PTR() for performance
      improvement in case of that self and other are shared.

  Modified files:
    trunk/ChangeLog
    trunk/array.c

Index: array.c
===================================================================
--- array.c	(revision 42042)
+++ array.c	(revision 42043)
@@ -3637,6 +3637,7 @@ rb_ary_equal(VALUE ary1, VALUE ary2) https://github.com/ruby/ruby/blob/trunk/array.c#L3637
 	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);
 }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42042)
+++ ChangeLog	(revision 42043)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul 18 21:15:41 2013  Masaki Matsushita  <glass.saga@g...>
+
+	* 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@g...>
 
 	* array.c (rb_ary_fill): use memfill().

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]