mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
vm.c (argnum_error): merge declaration and initialization
This commit is contained in:
@@ -1187,8 +1187,6 @@ catch_handler_find(const mrb_irep *irep, const mrb_code *pc, uint32_t filter)
|
||||
static void
|
||||
argnum_error(mrb_state *mrb, mrb_int num)
|
||||
{
|
||||
mrb_value exc;
|
||||
mrb_value str;
|
||||
mrb_int argc = mrb->c->ci->n;
|
||||
|
||||
if (argc == 15) {
|
||||
@@ -1200,8 +1198,8 @@ argnum_error(mrb_state *mrb, mrb_int num)
|
||||
if (argc == 0 && mrb->c->ci->nk != 0 && !mrb_hash_empty_p(mrb, mrb->c->ci->stack[1])) {
|
||||
argc++;
|
||||
}
|
||||
str = mrb_format(mrb, "wrong number of arguments (given %i, expected %i)", argc, num);
|
||||
exc = mrb_exc_new_str(mrb, E_ARGUMENT_ERROR, str);
|
||||
mrb_value str = mrb_format(mrb, "wrong number of arguments (given %i, expected %i)", argc, num);
|
||||
mrb_value exc = mrb_exc_new_str(mrb, E_ARGUMENT_ERROR, str);
|
||||
mrb_exc_set(mrb, exc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user