Browse Source

Drop 'else' condition when 'if' ends with a return (#4743)

This commit drops the else condition when the if block ends with a
return statement.

Signed-off-by: Vandewilly Silva <vandewilly.oli.silva@hpe.com>
pull/4745/merge
Vandewilly 6 years ago committed by Brian Brazil
parent
commit
1098ed89d8
  1. 6
      promql/value.go

6
promql/value.go

@ -149,9 +149,8 @@ func (vec Vector) ContainsSameLabelset() bool {
hash := s.Metric.Hash()
if _, ok := l[hash]; ok {
return true
} else {
l[hash] = struct{}{}
}
l[hash] = struct{}{}
}
return false
}
@ -193,9 +192,8 @@ func (m Matrix) ContainsSameLabelset() bool {
hash := ss.Metric.Hash()
if _, ok := l[hash]; ok {
return true
} else {
l[hash] = struct{}{}
}
l[hash] = struct{}{}
}
return false
}

Loading…
Cancel
Save