summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-13 08:18:58 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-13 08:18:58 +0000
commitd77f4934f8ede19d8a97d4bc748c92e9b8883133 (patch)
tree0212e2eab8e13124cb5f8d2283650ab75faf9cdc /enum.c
parent0579576d7740cf63e512eeb993558667713b1bc3 (diff)
* 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
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/enum.c b/enum.c
index 2516934..a49e4b0 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);