From 4c961b38618beaff222dbb7bae0dce1c64a5d0c3 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 27 Oct 2017 05:27:25 +0000 Subject: remove duplicated definition. * vm_insnhelper.c (vm_block_handler_to_proc): removed because it is same functionality of rb_vm_bh_to_procval(). Use rb_vm_bh_to_procval(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e4f79c5985..d1ba91b93c 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2498,29 +2498,6 @@ block_proc_is_lambda(const VALUE procval) } } -static VALUE -vm_block_handler_to_proc(rb_thread_t *th, VALUE block_handler) -{ - VALUE blockarg = Qnil; - - if (block_handler != VM_BLOCK_HANDLER_NONE) { - switch (vm_block_handler_type(block_handler)) { - case block_handler_type_proc: - blockarg = block_handler; - break; - case block_handler_type_symbol: - blockarg = rb_sym_to_proc(block_handler); - break; - case block_handler_type_iseq: - case block_handler_type_ifunc: - blockarg = rb_vm_make_proc(th->ec, VM_BH_TO_CAPT_BLOCK(block_handler), rb_cProc); - break; - } - } - - return blockarg; -} - static VALUE vm_yield_with_cfunc(rb_thread_t *th, const struct rb_captured_block *captured, @@ -2542,7 +2519,7 @@ vm_yield_with_cfunc(rb_thread_t *th, arg = argv[0]; } - blockarg = vm_block_handler_to_proc(th, block_handler); + blockarg = rb_vm_bh_to_procval(th->ec, block_handler); vm_push_frame(th->ec, (const rb_iseq_t *)captured->code.ifunc, VM_FRAME_MAGIC_IFUNC | VM_FRAME_FLAG_CFRAME, @@ -2559,7 +2536,7 @@ vm_yield_with_cfunc(rb_thread_t *th, static VALUE vm_yield_with_symbol(rb_thread_t *th, VALUE symbol, int argc, const VALUE *argv, VALUE block_handler) { - return rb_sym_proc_call(SYM2ID(symbol), argc, argv, vm_block_handler_to_proc(th, block_handler)); + return rb_sym_proc_call(SYM2ID(symbol), argc, argv, rb_vm_bh_to_procval(th->ec, block_handler)); } static inline int -- cgit v1.2.3