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>
This commit is contained in:
Vandewilly 2018-10-15 15:51:55 -07:00 committed by Brian Brazil
parent 69656c295d
commit 1098ed89d8

View file

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