optimize: even faster domain keyword matching

This commit is contained in:
mzz2017
2023-02-19 00:11:30 +08:00
parent 55c68a1676
commit cd588d017d
3 changed files with 4 additions and 4 deletions

View File

@ -111,7 +111,7 @@ func (n *AhocorasickSlimtrie) MatchDomainBitmap(domain string) (bitmap []uint32)
// Already matched.
continue
}
if hits := n.ac[i].MatchThreadSafe([]byte(domain)); len(hits) > 0 {
if n.ac[i].Contains([]byte(domain)) {
bitmap[i/32] |= 1 << (i % 32)
}
}