1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
glass 2015-05-13 08:18:58 +00:00
parent 0579576d77
commit d77f4934f8
2 changed files with 8 additions and 8 deletions

View file

@ -1,3 +1,10 @@
Wed May 13 17:10:37 2015 Masaki Matsushita <glass.saga@gmail.com>
* 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 <nobu@ruby-lang.org>
* parse.y (parse_gvar): separate message for gvar without

9
enum.c
View file

@ -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);