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

ruby-changes:3221

From: ko1@a...
Date: 26 Dec 2007 13:30:07 +0900
Subject: [ruby-changes:3221] nobu - Ruby:r14714 (trunk): * array.c (tmpbuf): use rb_str_tmp_new().

nobu	2007-12-26 13:29:37 +0900 (Wed, 26 Dec 2007)

  New Revision: 14714

  Modified files:
    trunk/ChangeLog
    trunk/array.c

  Log:
    * array.c (tmpbuf): use rb_str_tmp_new().


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/array.c?r1=14714&r2=14713
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14714&r2=14713

Index: array.c
===================================================================
--- array.c	(revision 14713)
+++ array.c	(revision 14714)
@@ -2969,15 +2969,9 @@
     return Qnil;
 }
 
-static VALUE
-tmpbuf(int n, int size)
-{
-    VALUE buf = rb_str_new(0, n*size);
+VALUE rb_str_tmp_new(long);
+#define tmpbuf(n, size) rb_str_tmp_new((n)*(size))
 
-    RBASIC(buf)->klass = 0;
-    return buf;
-}
-
 /*
  * Recursively compute permutations of r elements of the set [0..n-1].
  * When we have a complete permutation of array indexes, copy the values
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14713)
+++ ChangeLog	(revision 14714)
@@ -1,3 +1,7 @@
+Wed Dec 26 13:29:35 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* array.c (tmpbuf): use rb_str_tmp_new().
+
 Wed Dec 26 00:57:53 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/json/ext/generator/generator.c (Init_generator): requires

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

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