* 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:
parent
0579576d77
commit
d77f4934f8
@ -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>
|
Wed May 13 11:13:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (parse_gvar): separate message for gvar without
|
* parse.y (parse_gvar): separate message for gvar without
|
||||||
|
9
enum.c
9
enum.c
@ -515,14 +515,7 @@ enum_flat_map(VALUE obj)
|
|||||||
static VALUE
|
static VALUE
|
||||||
enum_to_a(int argc, VALUE *argv, VALUE obj)
|
enum_to_a(int argc, VALUE *argv, VALUE obj)
|
||||||
{
|
{
|
||||||
VALUE ary, size = rb_check_funcall(obj, id_size, 0, 0);
|
VALUE ary = rb_ary_new();
|
||||||
|
|
||||||
if (FIXNUM_P(size)) {
|
|
||||||
ary = rb_ary_new_capa(NUM2LONG(size));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ary = rb_ary_new();
|
|
||||||
}
|
|
||||||
|
|
||||||
rb_block_call(obj, id_each, argc, argv, collect_all, ary);
|
rb_block_call(obj, id_each, argc, argv, collect_all, ary);
|
||||||
OBJ_INFECT(ary, obj);
|
OBJ_INFECT(ary, obj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user