Skip to content

Commit

Permalink
Readability of range loop
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceJJones authored Jan 25, 2025
1 parent 5b45ebb commit 41177a3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/acquisition/modules/appsec/appsec_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ func (r *AppsecRunner) MergeDedupRules(collections []appsec.AppsecCollection, lo
for _, collection := range collections {
// Dedup *our* rules
for _, rule := range collection.Rules {
if _, ok := dedupRules[rule]; !ok {
rulesArr = append(rulesArr, rule)
dedupRules[rule] = struct{}{}
} else {
discarded++
logger.Debugf("Discarding duplicate rule : %s", rule)
if _, ok := dedupRules[rule]; ok {
discarded++
logger.Debugf("Discarding duplicate rule : %s", rule)
continue
}
rulesArr = append(rulesArr, rule)
dedupRules[rule] = struct{}{}
}
// Don't mess up with native modsec rules
rulesArr = append(rulesArr, collection.NativeRules...)
Expand Down

0 comments on commit 41177a3

Please sign in to comment.