Simplify inhibition mute check

This commit is contained in:
Fabian Reinartz 2015-09-28 22:08:47 +02:00
parent 365b641223
commit 0fdaf263c1
1 changed files with 6 additions and 7 deletions

View File

@ -110,15 +110,14 @@ func NewInhibitRule(cr *config.InhibitRule) *InhibitRule {
}
func (r *InhibitRule) Mutes(source, target model.LabelSet) bool {
if r.TargetMatchers.Match(target) && r.SourceMatchers.Match(source) {
for ln := range r.Equal {
if source[ln] != target[ln] {
return false
}
}
} else {
if !r.TargetMatchers.Match(target) || !r.SourceMatchers.Match(source) {
return false
}
for ln := range r.Equal {
if source[ln] != target[ln] {
return false
}
}
return true
}