forked from mirror/client_golang
remove reference to metrics after reslicing
Signed-off-by: Dima Kozlov <hummerd@mail.ru>
This commit is contained in:
parent
d3accfda21
commit
0c48254b62
|
@ -276,7 +276,9 @@ func (m *metricMap) deleteByHashWithLabelValues(
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(metrics) > 1 {
|
if len(metrics) > 1 {
|
||||||
|
old := metrics
|
||||||
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
|
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
|
||||||
|
old[len(old)-1] = metricWithLabelValues{}
|
||||||
} else {
|
} else {
|
||||||
delete(m.metrics, h)
|
delete(m.metrics, h)
|
||||||
}
|
}
|
||||||
|
@ -302,7 +304,9 @@ func (m *metricMap) deleteByHashWithLabels(
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(metrics) > 1 {
|
if len(metrics) > 1 {
|
||||||
|
old := metrics
|
||||||
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
|
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
|
||||||
|
old[len(old)-1] = metricWithLabelValues{}
|
||||||
} else {
|
} else {
|
||||||
delete(m.metrics, h)
|
delete(m.metrics, h)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue