From d77f4934f8ede19d8a97d4bc748c92e9b8883133 Mon Sep 17 00:00:00 2001 From: glass Date: Wed, 13 May 2015 08:18:58 +0000 Subject: * enum.c (enum_to_a): revert r50457. it requires recursion check. then, it doesn't make performance improvement. [Bug #11130] [Feature #9118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enum.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index 2516934814..a49e4b0b74 100644 --- a/enum.c +++ b/enum.c @@ -515,14 +515,7 @@ enum_flat_map(VALUE obj) 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); -- cgit v1.2.3