Simplify inhibition mute check
This commit is contained in:
parent
365b641223
commit
0fdaf263c1
13
inhibit.go
13
inhibit.go
|
@ -110,15 +110,14 @@ func NewInhibitRule(cr *config.InhibitRule) *InhibitRule {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *InhibitRule) Mutes(source, target model.LabelSet) bool {
|
func (r *InhibitRule) Mutes(source, target model.LabelSet) bool {
|
||||||
if r.TargetMatchers.Match(target) && r.SourceMatchers.Match(source) {
|
if !r.TargetMatchers.Match(target) || !r.SourceMatchers.Match(source) {
|
||||||
for ln := range r.Equal {
|
|
||||||
if source[ln] != target[ln] {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
for ln := range r.Equal {
|
||||||
|
if source[ln] != target[ln] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue