Skip to content

Commit

Permalink
fix: remove duplicated matcher split
Browse files Browse the repository at this point in the history
  • Loading branch information
acynothia authored Nov 3, 2024
1 parent b653f78 commit cddfd83
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scope_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ func WildcardScopeStrategy(matchers []string, needle string) bool {
needleParts := strings.Split(needle, ".")
for _, matcher := range matchers {
matcherParts := strings.Split(matcher, ".")

if len(matcherParts) > len(needleParts) {
continue
}

var noteq bool
for k, c := range strings.Split(matcher, ".") {
for k, c := range matcherParts {
// this is the last item and the lengths are different
if k == len(matcherParts)-1 && len(matcherParts) != len(needleParts) {
if c != "*" {
Expand Down

0 comments on commit cddfd83

Please sign in to comment.