MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / Less

Method Less

pkg/util/json/json.go:303–312  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

301}
302
303func (s *pairSorter) Less(i, j int) bool {
304 cmp := strings.Compare(string(s.pairs[i].k), string(s.pairs[j].k))
305 if cmp != 0 {
306 return cmp == -1
307 }
308 s.hasNonUnique = true
309 // The element with greater order has lower rank when their keys
310 // are same, since unique algorithm will prefer first element.
311 return s.orders[i] > s.orders[j]
312}
313
314func (s *pairSorter) Swap(i, j int) {
315 s.pairs[i], s.orders[i], s.pairs[j], s.orders[j] = s.pairs[j], s.orders[j], s.pairs[i], s.orders[i]

Callers

nothing calls this directly

Calls 1

CompareMethod · 0.65

Tested by

no test coverage detected