From d77f4934f8ede19d8a97d4bc748c92e9b8883133 Mon Sep 17 00:00:00 2001 From: glass Date: Wed, 13 May 2015 08:18:58 +0000 Subject: [PATCH] * 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 --- ChangeLog | 7 +++++++ enum.c | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7fbd01289..55a217aeb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed May 13 17:10:37 2015 Masaki Matsushita + + * 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 * parse.y (parse_gvar): separate message for gvar without 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);