From a4334e1d52afe75daf00c87088e14287df404116 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sat, 29 Apr 2023 01:10:55 +0800 Subject: [PATCH] fix: wildcard matching problem (#536) --- component/trie/domain_set.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/component/trie/domain_set.go b/component/trie/domain_set.go index be793ad39b..41ca2161db 100644 --- a/component/trie/domain_set.go +++ b/component/trie/domain_set.go @@ -104,8 +104,8 @@ func (ss *DomainSet) Has(key string) bool { goto RESTART } } - for ; ; nextBmIdx++ { - if nextBmIdx-nextNodeId < len(ss.labels) && ss.labels[nextBmIdx-nextNodeId] == domainStepByte { + for ; nextBmIdx-nextNodeId < len(ss.labels); nextBmIdx++ { + if ss.labels[nextBmIdx-nextNodeId] == domainStepByte { bmIdx = nextBmIdx nodeId = nextNodeId i = j