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

Refactor rb_block_call function

rb_block_call and rb_block_call_kw have similar code.
So, using rb_block_kw function in rb_block_call function for refactoring.
This commit is contained in:
S.H 2021-06-13 13:44:46 +09:00 committed by GitHub
parent 146721ef6a
commit d54f74a48b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2021-06-13 13:45:19 +09:00
Merged: https://github.com/ruby/ruby/pull/4566

Merged-By: nobu <nobu@ruby-lang.org>

View file

@ -1579,18 +1579,13 @@ iterate_method(VALUE obj)
return rb_call(arg->obj, arg->mid, arg->argc, arg->argv, arg->kw_splat ? CALL_FCALL_KW : CALL_FCALL);
}
VALUE rb_block_call_kw(VALUE obj, ID mid, int argc, const VALUE * argv, rb_block_call_func_t bl_proc, VALUE data2, int kw_splat);
VALUE
rb_block_call(VALUE obj, ID mid, int argc, const VALUE * argv,
rb_block_call_func_t bl_proc, VALUE data2)
{
struct iter_method_arg arg;
arg.obj = obj;
arg.mid = mid;
arg.argc = argc;
arg.argv = argv;
arg.kw_splat = 0;
return rb_iterate(iterate_method, (VALUE)&arg, bl_proc, data2);
return rb_block_call_kw(obj, mid, argc, argv, bl_proc, data2, RB_NO_KEYWORDS);
}
VALUE