From be294f140b95b926efcba91e26d9e39747eb0531 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sat, 13 Apr 2024 09:46:38 +0100 Subject: [PATCH] LabelSet.String: restore faster sort call Signed-off-by: Bryan Boreham --- model/labelset_string.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/labelset_string.go b/model/labelset_string.go index 174753ed..481c47b4 100644 --- a/model/labelset_string.go +++ b/model/labelset_string.go @@ -17,7 +17,7 @@ package model import ( "bytes" - "sort" + "slices" "strconv" ) @@ -28,7 +28,7 @@ func (l LabelSet) String() string { for name := range l { labelNames = append(labelNames, string(name)) } - sort.Strings(labelNames) + slices.Sort(labelNames) var bytea [1024]byte // On stack to avoid memory allocation while building the output. b := bytes.NewBuffer(bytea[:0]) b.WriteByte('{')