Skip to content

Commit a91f55d

Browse files
committed
Early exit from loop
1 parent 7b45a29 commit a91f55d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/regexp/onepass.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ func compileOnePass(prog *syntax.Prog) (p *onePassProg) {
476476
for _, inst := range prog.Inst {
477477
if inst.Op == syntax.InstAlt || inst.Op == syntax.InstAltMatch {
478478
hasAlt = true
479+
break
479480
}
480481
}
481482
// If we have alternates, every instruction leading to InstMatch must be EmptyEndText.

0 commit comments

Comments
 (0)