Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions model/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package model

import (
"sort"
"slices"
)

// SeparatorByte is a byte that cannot occur in valid UTF-8 sequences and is
Expand All @@ -37,7 +37,7 @@ func LabelsToSignature(labels map[string]string) uint64 {
for labelName := range labels {
labelNames = append(labelNames, labelName)
}
sort.Strings(labelNames)
slices.Sort(labelNames)

sum := hashNew()
for _, labelName := range labelNames {
Expand All @@ -60,7 +60,7 @@ func labelSetToFingerprint(ls LabelSet) Fingerprint {
for labelName := range ls {
labelNames = append(labelNames, labelName)
}
sort.Sort(labelNames)
slices.Sort(labelNames)

sum := hashNew()
for _, labelName := range labelNames {
Expand Down Expand Up @@ -100,7 +100,7 @@ func SignatureForLabels(m Metric, labels ...LabelName) uint64 {
return emptyLabelSignature
}

sort.Sort(LabelNames(labels))
slices.Sort(labels)

sum := hashNew()
for _, label := range labels {
Expand Down Expand Up @@ -129,7 +129,7 @@ func SignatureWithoutLabels(m Metric, labels map[LabelName]struct{}) uint64 {
if len(labelNames) == 0 {
return emptyLabelSignature
}
sort.Sort(labelNames)
slices.Sort(labelNames)

sum := hashNew()
for _, labelName := range labelNames {
Expand Down
Loading