mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promrelabel: use clear() function inside CleanLabels()
This commit is contained in:
parent
69ab55b6f7
commit
cf2e80a869
1 changed files with 1 additions and 3 deletions
|
@ -589,9 +589,7 @@ func GetLabelByName(labels []prompbmarshal.Label, name string) *prompbmarshal.La
|
|||
//
|
||||
// This should help GC cleaning up label.Name and label.Value strings.
|
||||
func CleanLabels(labels []prompbmarshal.Label) {
|
||||
for i := range labels {
|
||||
labels[i] = prompbmarshal.Label{}
|
||||
}
|
||||
clear(labels)
|
||||
}
|
||||
|
||||
// LabelsToString returns Prometheus string representation for the given labels.
|
||||
|
|
Loading…
Reference in a new issue