Skip to content

Commit

Permalink
Remove duplicate rule detection
Browse files Browse the repository at this point in the history
  • Loading branch information
NHAS committed May 2, 2023
1 parent 202b7fe commit 441357d
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions internal/routetypes/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,11 @@ type Rule struct {

func ParseRules(restrictionType PolicyType, rules []string) (result []Rule, err error) {

assignedRoutes := map[string]bool{}

for _, rule := range rules {
r, err := ParseRule(restrictionType, rule)
if err != nil {
return nil, err
}

for _, k := range r.Keys {
if _, ok := assignedRoutes[k.String()]; ok {
return nil, errors.New("route " + k.String() + " already defined")
}
assignedRoutes[k.String()] = true
}

result = append(result, r)
}

Expand Down

0 comments on commit 441357d

Please sign in to comment.