rb_method_call_status: 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
f12efec2c2
commit
edb1680a05
Notes:
git
2020-06-29 11:06:36 +09:00
@ -632,8 +632,7 @@ rb_method_call_status(rb_execution_context_t *ec, const rb_callable_method_entry
|
||||
rb_method_visibility_t visi;
|
||||
|
||||
if (UNDEFINED_METHOD_ENTRY_P(me)) {
|
||||
undefined:
|
||||
return scope == CALL_VCALL ? MISSING_VCALL : MISSING_NOENTRY;
|
||||
goto undefined;
|
||||
}
|
||||
if (me->def->type == VM_METHOD_TYPE_REFINED) {
|
||||
me = rb_resolve_refined_method_callable(Qnil, me);
|
||||
@ -667,6 +666,8 @@ rb_method_call_status(rb_execution_context_t *ec, const rb_callable_method_entry
|
||||
}
|
||||
|
||||
return MISSING_NONE;
|
||||
undefined:
|
||||
return scope == CALL_VCALL ? MISSING_VCALL : MISSING_NOENTRY;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user