regexp: use built-in clear to clear b.visited in *bitState.reset

This commit is contained in:
Jes Cok 2023-09-13 20:54:28 +08:00
parent 0460c61e5f
commit 465da88feb
1 changed files with 1 additions and 3 deletions

View File

@ -91,9 +91,7 @@ func (b *bitState) reset(prog *syntax.Prog, end int, ncap int) {
b.visited = make([]uint32, visitedSize, maxBacktrackVector/visitedBits)
} else {
b.visited = b.visited[:visitedSize]
for i := range b.visited {
b.visited[i] = 0
}
clear(b.visited) // set to 0
}
if cap(b.cap) < ncap {