MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Less

Method Less

postgres/parser/json/json.go:353–362  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

351}
352
353func (s *pairSorter) Less(i, j int) bool {
354 cmp := strings.Compare(string(s.pairs[i].k), string(s.pairs[j].k))
355 if cmp != 0 {
356 return cmp == -1
357 }
358 s.hasNonUnique = true
359 // The element with greater order has lower rank when their keys
360 // are same, since unique algorithm will prefer first element.
361 return s.orders[i] > s.orders[j]
362}
363
364func (s *pairSorter) Swap(i, j int) {
365 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