Skip to content

Commit

Permalink
PR notes & linter
Browse files Browse the repository at this point in the history
Co-authored-by: ThinkChaos <[email protected]>
  • Loading branch information
zc-devs and ThinkChaos committed Apr 24, 2024
1 parent 0a9df2f commit 8eff14f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cache/stringcache/string_caches.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ func (cache stringMap) contains(searchString string) bool {
if idx < searchBucketLen {
blockRule := cache[searchLen][idx*searchLen : idx*searchLen+searchLen]
if blockRule == normalized {
log.PrefixedLog("stringMap").Debugf("block rule '%s' matched with '%s'", blockRule, searchString)
log.PrefixedLog("string_map").Debugf("block rule '%s' matched with '%s'", blockRule, searchString)

return true
}
}
Expand Down Expand Up @@ -136,7 +137,7 @@ func (cache regexCache) elementCount() int {
func (cache regexCache) contains(searchString string) bool {
for _, regex := range cache {
if regex.MatchString(searchString) {
log.PrefixedLog("regexCache").Debugf("regex '%s' matched with '%s'", regex, searchString)
log.PrefixedLog("regex_cache").Debugf("regex '%s' matched with '%s'", regex, searchString)

return true
}
Expand Down
4 changes: 3 additions & 1 deletion trie/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func (n *parent) insert(key string, split SplitFunc) {
func (n *parent) hasParentOf(key string, split SplitFunc) bool {
searchString := key
rule := ""

for {
label, rest := split(key)
rule = strings.Join([]string{label, rule}, ".")
Expand Down Expand Up @@ -144,8 +145,9 @@ func (n *parent) hasParentOf(key string, split SplitFunc) bool {
if matched {
rule = strings.Join([]string{child.String(), rule}, ".")
rule = strings.Trim(rule, ".")
log.PrefixedLog("Trie").Debugf("wildcard block rule '%s' matched with '%s'", rule, searchString)
log.PrefixedLog("trie").Debugf("wildcard block rule '%s' matched with '%s'", rule, searchString)
}

return matched
}
}
Expand Down

0 comments on commit 8eff14f

Please sign in to comment.