diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-16 08:33:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-16 08:33:10 +0000 |
commit | 19451891d8750a44097fae76422642bd288e9197 (patch) | |
tree | 376c15d8de8e17f614f5ac9c4794fa52a2e786a7 /enum.c | |
parent | a920c29c16c8ffa2afe3f4126d307ee0001d5bc8 (diff) |
* enum.c (enum_take): allocate buffer array before iteration, as well
as enum_first did.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |