chore: add classical provider for nameserver-policy, and rename domain-set to rule-set

This commit is contained in:
Skyxim
2023-03-29 16:28:26 +08:00
parent 75ed879121
commit 82dddf932a
8 changed files with 30 additions and 15 deletions

View File

@ -20,7 +20,7 @@ type Set struct {
leaves, labelBitmap []uint64
labels []byte
ranks, selects []int32
isEmpty bool
isEmpty bool
}
// NewSet creates a new *Set struct, from a slice of sorted strings.
@ -48,7 +48,7 @@ func NewDomainTrieSet(keys []string) *Set {
keys = reserveDomains
ss := &Set{}
if len(keys) == 0 {
ss.isEmpty=true
ss.isEmpty = true
return ss
}
lIdx := 0
@ -84,7 +84,7 @@ func NewDomainTrieSet(keys []string) *Set {
// Has query for a key and return whether it presents in the Set.
func (ss *Set) Has(key string) bool {
if ss.isEmpty{
if ss.isEmpty {
return false
}
key = utils.Reverse(key)