Codebase list golang-github-go-kit-kit / da68e76
metrics/internal/lv: fix len comparison Peter Bourgon 4 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
7878 func (n *node) observe(lvs LabelValues, value float64) {
7979 n.mtx.Lock()
8080 defer n.mtx.Unlock()
81 if len(lvs) == 0 {
81 if len(lvs) <= 0 {
8282 n.observations = append(n.observations, value)
8383 return
8484 }
100100 func (n *node) add(lvs LabelValues, delta float64) {
101101 n.mtx.Lock()
102102 defer n.mtx.Unlock()
103 if len(lvs) == 0 {
103 if len(lvs) <= 0 {
104104 var value float64
105105 if len(n.observations) > 0 {
106106 value = last(n.observations) + delta