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

ruby-changes:38402

From: glass <ko1@a...>
Date: Wed, 13 May 2015 17:19:16 +0900 (JST)
Subject: [ruby-changes:38402] glass:r50483 (trunk): * enum.c (enum_to_a): revert r50457.

glass	2015-05-13 17:18:58 +0900 (Wed, 13 May 2015)

  New Revision: 50483

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

  Log:
    * enum.c (enum_to_a): revert r50457.
      it requires recursion check.
      then, it doesn't make performance improvement.
      [Bug #11130] [Feature #9118]

  Modified files:
    trunk/ChangeLog
    trunk/enum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50482)
+++ ChangeLog	(revision 50483)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May 13 17:10:37 2015  Masaki Matsushita <glass.saga@g...>
+
+	* enum.c (enum_to_a): revert r50457.
+	  it requires recursion check.
+	  then, it doesn't make performance improvement.
+	  [Bug #11130] [Feature #9118]
+
 Wed May 13 11:13:40 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parse_gvar): separate message for gvar without
Index: enum.c
===================================================================
--- enum.c	(revision 50482)
+++ enum.c	(revision 50483)
@@ -515,14 +515,7 @@ enum_flat_map(VALUE obj) https://github.com/ruby/ruby/blob/trunk/enum.c#L515
 static VALUE
 enum_to_a(int argc, VALUE *argv, VALUE obj)
 {
-    VALUE ary, size = rb_check_funcall(obj, id_size, 0, 0);
-
-    if (FIXNUM_P(size)) {
-	ary = rb_ary_new_capa(NUM2LONG(size));
-    }
-    else {
-	ary = rb_ary_new();
-    }
+    VALUE ary = rb_ary_new();
 
     rb_block_call(obj, id_each, argc, argv, collect_all, ary);
     OBJ_INFECT(ary, obj);

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

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