Skip to content

Commit cd41db3

Browse files
ALTreebradfitz
authored andcommitted
regexp: remove unreachable code
Found running go vet on the package. It barks that regexp/backtrack.go:257: unreachable code regexp/backtrack.go:302: unreachable code For #11041 Change-Id: I0f5ba0d6183108fba3d144991b826273db0ffb09 Reviewed-on: https://go-review.googlesource.com/19824 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
1 parent 4ded58b commit cd41db3

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/regexp/backtrack.go

-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ func (m *machine) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool {
254254

255255
}
256256
panic("bad arg in InstCapture")
257-
continue
258257

259258
case syntax.InstEmptyWidth:
260259
if syntax.EmptyOp(inst.Arg)&^i.context(pos) != 0 {
@@ -299,7 +298,6 @@ func (m *machine) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool {
299298
// Otherwise, continue on in hope of a longer match.
300299
continue
301300
}
302-
panic("unreachable")
303301
}
304302

305303
return m.matched

0 commit comments

Comments
 (0)