MCPcopy Create free account
hub / github.com/prometheus/common / Less

Method Less

model/labels.go:201–214  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

199}
200
201func (l LabelPairs) Less(i, j int) bool {
202 switch {
203 case l[i].Name > l[j].Name:
204 return false
205 case l[i].Name < l[j].Name:
206 return true
207 case l[i].Value > l[j].Value:
208 return false
209 case l[i].Value < l[j].Value:
210 return true
211 default:
212 return false
213 }
214}
215
216func (l LabelPairs) Swap(i, j int) {
217 l[i], l[j] = l[j], l[i]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected