summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index 1be1deab1a..fd5ba1cd48 100644
--- a/enum.c
+++ b/enum.c
@@ -2050,7 +2050,7 @@ enum_take(VALUE obj, VALUE n)
}
if (len == 0) return rb_ary_new2(0);
- result = rb_ary_new();
+ result = rb_ary_new2(len);
memo = NEW_MEMO(result, 0, len);
rb_block_call(obj, id_each, 0, 0, take_i, (VALUE)memo);
return result;