metrics/internal/lv: fix len comparison
Peter Bourgon
4 years ago
78 | 78 | func (n *node) observe(lvs LabelValues, value float64) { |
79 | 79 | n.mtx.Lock() |
80 | 80 | defer n.mtx.Unlock() |
81 | if len(lvs) == 0 { | |
81 | if len(lvs) <= 0 { | |
82 | 82 | n.observations = append(n.observations, value) |
83 | 83 | return |
84 | 84 | } |
100 | 100 | func (n *node) add(lvs LabelValues, delta float64) { |
101 | 101 | n.mtx.Lock() |
102 | 102 | defer n.mtx.Unlock() |
103 | if len(lvs) == 0 { | |
103 | if len(lvs) <= 0 { | |
104 | 104 | var value float64 |
105 | 105 | if len(n.observations) > 0 { |
106 | 106 | value = last(n.observations) + delta |