Skip to content

Commit

Permalink
Merge pull request #784 from hummerd/master
Browse files Browse the repository at this point in the history
Remove reference to Metric after reslicing
  • Loading branch information
beorn7 committed Jul 24, 2020
2 parents 77b35d0 + 0c48254 commit c650ae9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions prometheus/vec.go
Expand Up @@ -276,7 +276,9 @@ func (m *metricMap) deleteByHashWithLabelValues(
}

if len(metrics) > 1 {
old := metrics
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
old[len(old)-1] = metricWithLabelValues{}
} else {
delete(m.metrics, h)
}
Expand All @@ -302,7 +304,9 @@ func (m *metricMap) deleteByHashWithLabels(
}

if len(metrics) > 1 {
old := metrics
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
old[len(old)-1] = metricWithLabelValues{}
} else {
delete(m.metrics, h)
}
Expand Down

0 comments on commit c650ae9

Please sign in to comment.