mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
enumerator.c: use ALLOCV
* enumerator.c (lazy_init_iterator): use ALLOCV instead of tmp array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e996628bec
commit
5987e6a50b
1 changed files with 5 additions and 5 deletions
10
enumerator.c
10
enumerator.c
|
@ -1331,14 +1331,14 @@ lazy_init_iterator(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
|
|||
else {
|
||||
VALUE args;
|
||||
int len = rb_long2int((long)argc + 1);
|
||||
VALUE *nargv = ALLOCV_N(VALUE, args, len);
|
||||
|
||||
args = rb_ary_tmp_new(len);
|
||||
rb_ary_push(args, m);
|
||||
nargv[0] = m;
|
||||
if (argc > 0) {
|
||||
rb_ary_cat(args, argv, argc);
|
||||
MEMCPY(nargv + 1, argv, VALUE, argc);
|
||||
}
|
||||
result = rb_yield_values2(len, RARRAY_CONST_PTR(args));
|
||||
RB_GC_GUARD(args);
|
||||
result = rb_yield_values2(len, nargv);
|
||||
ALLOCV_END(args);
|
||||
}
|
||||
if (result == Qundef) rb_iter_break();
|
||||
return Qnil;
|
||||
|
|
Loading…
Reference in a new issue