Simplify inhibition mute check
This commit is contained in:
parent
365b641223
commit
0fdaf263c1
|
@ -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) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
for ln := range r.Equal {
|
for ln := range r.Equal {
|
||||||
if source[ln] != target[ln] {
|
if source[ln] != target[ln] {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue