diff options
author | S.H <gamelinks007@gmail.com> | 2021-06-13 13:44:46 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-13 13:44:46 +0900 |
commit | d54f74a48b8b996f9c27077e28d9d24f2c4e4c1d (patch) | |
tree | 441b0f2219642664f0e456a836f424cd562141e6 /vm_eval.c | |
parent | 146721ef6a46d1d7ed6c9452c2c6c6342fafc8b0 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4566
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -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 |