Skip to content

Commit 6301790

Browse files
committed
debugui: refactoring
1 parent afeb043 commit 6301790

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

command.go

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,19 @@ func (c *Context) commands() iter.Seq[*command] {
9090
}
9191

9292
cmd := c.commandList[0]
93-
loop:
94-
for {
95-
for cmd.idx < len(c.commandList) {
96-
if cmd.typ != commandJump {
97-
if !yield(cmd) {
98-
return
99-
}
100-
cmd = c.commandList[cmd.idx+1]
101-
continue loop
102-
}
103-
idx := cmd.jump.dstIdx
104-
if idx > len(c.commandList)-1 {
93+
for cmd.idx < len(c.commandList) {
94+
if cmd.typ != commandJump {
95+
if !yield(cmd) {
10596
return
10697
}
107-
cmd = c.commandList[idx]
98+
cmd = c.commandList[cmd.idx+1]
99+
continue
108100
}
109-
return
101+
idx := cmd.jump.dstIdx
102+
if idx > len(c.commandList)-1 {
103+
return
104+
}
105+
cmd = c.commandList[idx]
110106
}
111107
}
112108
}

0 commit comments

Comments
 (0)