mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
compile.c: trivial refactoring
Use `for` instead of `while` to make it explicit that it is a traverse of bytecode.
This commit is contained in:
parent
8852fa8760
commit
f9754f0ea0
1 changed files with 1 additions and 3 deletions
|
@ -2048,9 +2048,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
|
|||
if (stack_max < 0) return COMPILE_NG;
|
||||
|
||||
/* fix label position */
|
||||
list = FIRST_ELEMENT(anchor);
|
||||
insn_num = code_index = 0;
|
||||
while (list) {
|
||||
for (list = FIRST_ELEMENT(anchor); list; list = list->next) {
|
||||
switch (list->type) {
|
||||
case ISEQ_ELEMENT_INSN:
|
||||
{
|
||||
|
@ -2109,7 +2108,6 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
|
|||
}
|
||||
default: break;
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
/* make instruction sequence */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue