mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
lib/promrelabel: use clear() function inside CleanLabels()
This commit is contained in:
parent
69ab55b6f7
commit
cf2e80a869
@ -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 New Issue
Block a user