Skip to content

Commit be294f1

Browse files
committed
LabelSet.String: restore faster sort call
Signed-off-by: Bryan Boreham <[email protected]>
1 parent 0234594 commit be294f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

model/labelset_string.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package model
1717

1818
import (
1919
"bytes"
20-
"sort"
20+
"slices"
2121
"strconv"
2222
)
2323

@@ -28,7 +28,7 @@ func (l LabelSet) String() string {
2828
for name := range l {
2929
labelNames = append(labelNames, string(name))
3030
}
31-
sort.Strings(labelNames)
31+
slices.Sort(labelNames)
3232
var bytea [1024]byte // On stack to avoid memory allocation while building the output.
3333
b := bytes.NewBuffer(bytea[:0])
3434
b.WriteByte('{')

0 commit comments

Comments
 (0)