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

ruby-changes:29994

From: glass <ko1@a...>
Date: Thu, 18 Jul 2013 23:47:37 +0900 (JST)
Subject: [ruby-changes:29994] glass:r42046 (trunk): * array.c (rb_ary_eql): compare RARRAY_PTR() for performance

glass	2013-07-18 23:47:27 +0900 (Thu, 18 Jul 2013)

  New Revision: 42046

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

  Log:
    * array.c (rb_ary_eql): 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 42045)
+++ array.c	(revision 42046)
@@ -3668,6 +3668,7 @@ rb_ary_eql(VALUE ary1, VALUE ary2) https://github.com/ruby/ruby/blob/trunk/array.c#L3668
     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);
 }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42045)
+++ ChangeLog	(revision 42046)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul 18 23:45:06 2013  Masaki Matsushita  <glass.saga@g...>
+
+	* 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@z...>
 
 	* lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]

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

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