mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
model/labels (stringlabels): use strings.Clone
Suggestion from @colega. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
d16ce3c9bd
commit
55e7de04f8
|
@ -188,8 +188,7 @@ func (ls Labels) BytesWithoutLabels(buf []byte, names ...string) []byte {
|
||||||
|
|
||||||
// Copy returns a copy of the labels.
|
// Copy returns a copy of the labels.
|
||||||
func (ls Labels) Copy() Labels {
|
func (ls Labels) Copy() Labels {
|
||||||
buf := append([]byte{}, ls.data...)
|
return Labels{data: strings.Clone(ls.data)}
|
||||||
return Labels{data: yoloString(buf)}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get returns the value for the label with the given name.
|
// Get returns the value for the label with the given name.
|
||||||
|
|
Loading…
Reference in a new issue