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

ruby-changes:29990

From: glass <ko1@a...>
Date: Thu, 18 Jul 2013 20:52:05 +0900 (JST)
Subject: [ruby-changes:29990] glass:r42042 (trunk): * array.c (rb_ary_fill): use memfill().

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

  New Revision: 42042

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

  Log:
    * array.c (rb_ary_fill): use memfill().

  Modified files:
    trunk/ChangeLog
    trunk/array.c

Index: array.c
===================================================================
--- array.c	(revision 42041)
+++ array.c	(revision 42042)
@@ -3327,7 +3327,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/array.c#L3327
 {
     VALUE item, arg1, arg2;
     long beg = 0, end = 0, len = 0;
-    VALUE *p, *pend;
+    VALUE *p;
     int block_p = FALSE;
 
     if (rb_block_given_p()) {
@@ -3385,10 +3385,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/array.c#L3385
     }
     else {
 	p = RARRAY_PTR(ary) + beg;
-	pend = p + len;
-	while (p < pend) {
-	    *p++ = item;
-	}
+	memfill(p, len, item);
     }
     return ary;
 }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42041)
+++ ChangeLog	(revision 42042)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul 18 20:44:51 2013  Masaki Matsushita  <glass.saga@g...>
+
+	* array.c (rb_ary_fill): use memfill().
+
 Thu Jul 18 20:35:14 2013  Benoit Daloze  <eregontp@g...>
 
 	* array.c (rb_ary_count): check length to avoid SEGV

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

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