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.
|
||||
func (ls Labels) Copy() Labels {
|
||||
buf := append([]byte{}, ls.data...)
|
||||
return Labels{data: yoloString(buf)}
|
||||
return Labels{data: strings.Clone(ls.data)}
|
||||
}
|
||||
|
||||
// Get returns the value for the label with the given name.
|
||||
|
|
Loading…
Reference in New Issue