optimize_checktype: 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
a5342f46e6
commit
a6b1454a5d
Notes:
git
2020-06-29 11:07:12 +09:00
@ -2746,7 +2746,6 @@ optimize_checktype(rb_iseq_t *iseq, INSN *iobj)
|
||||
if (!ciobj || !IS_INSN_ID(ciobj, checktype)) return FALSE;
|
||||
niobj = (INSN *)get_next_insn(ciobj);
|
||||
if (!niobj) {
|
||||
no_branch:
|
||||
/* TODO: putobject true/false */
|
||||
return FALSE;
|
||||
}
|
||||
@ -2762,7 +2761,7 @@ optimize_checktype(rb_iseq_t *iseq, INSN *iobj)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto no_branch;
|
||||
return FALSE;
|
||||
}
|
||||
line = ciobj->insn_info.line_no;
|
||||
if (!dest) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user