Skip to content

Commit

Permalink
Remove unused mutex in RuleGroup (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
nacx authored Aug 31, 2022
1 parent fea0b3c commit d570d1d
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions rulegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package coraza

import (
"fmt"
"sync"
"time"

"github.com/corazawaf/coraza/v3/internal/strings"
Expand All @@ -18,7 +17,6 @@ import (
// after compilation
type RuleGroup struct {
rules []*Rule
mux *sync.RWMutex
}

// Add a rule to the collection
Expand All @@ -37,10 +35,7 @@ func (rg *RuleGroup) Add(rule *Rule) error {
}

// GetRules returns the slice of rules,
// it's concurrent safe.
func (rg *RuleGroup) GetRules() []*Rule {
rg.mux.RLock()
defer rg.mux.RUnlock()
return rg.rules
}

Expand Down Expand Up @@ -157,6 +152,5 @@ RulesLoop:
func NewRuleGroup() RuleGroup {
return RuleGroup{
rules: []*Rule{},
mux: &sync.RWMutex{},
}
}

0 comments on commit d570d1d

Please sign in to comment.