mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
method_missing: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
This commit is contained in:
parent
edb1680a05
commit
6e67b30503
Notes:
git
2020-06-29 11:06:35 +09:00
1 changed files with 3 additions and 2 deletions
|
@ -820,8 +820,7 @@ method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missin
|
|||
ec->method_missing_reason = call_status;
|
||||
|
||||
if (id == idMethodMissing) {
|
||||
missing:
|
||||
raise_method_missing(ec, argc, argv, obj, call_status | MISSING_MISSING);
|
||||
goto missing;
|
||||
}
|
||||
|
||||
nargv = ALLOCV_N(VALUE, work, argc + 1);
|
||||
|
@ -845,6 +844,8 @@ method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missin
|
|||
result = rb_vm_call_kw(ec, obj, idMethodMissing, argc, argv, me, kw_splat);
|
||||
if (work) ALLOCV_END(work);
|
||||
return result;
|
||||
missing:
|
||||
raise_method_missing(ec, argc, argv, obj, call_status | MISSING_MISSING);
|
||||
}
|
||||
|
||||
#ifndef MJIT_HEADER
|
||||
|
|
Loading…
Reference in a new issue