mirror of https://github.com/golang/go.git
regexp: use built-in clear to clear b.visited in *bitState.reset
Change-Id: I1a723124f7050aeb971377db8c3cd04ebf9f7a16
GitHub-Last-Rev: 465da88feb
GitHub-Pull-Request: golang/go#62611
Reviewed-on: https://go-review.googlesource.com/c/go/+/527975
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
parent
a03f1aeb55
commit
0256198129
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue