MCPcopy Create free account
hub / github.com/blues/note / Less

Method Less

jsonxt/encode.go:1056–1066  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

1054func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
1055
1056func (x byIndex) Less(i, j int) bool {
1057 for k, xik := range x[i].index {
1058 if k >= len(x[j].index) {
1059 return false
1060 }
1061 if xik != x[j].index[k] {
1062 return xik < x[j].index[k]
1063 }
1064 }
1065 return len(x[i].index) < len(x[j].index)
1066}
1067
1068// typeFields returns a list of fields that JSON should recognize for the given type.
1069// The algorithm is breadth-first search over the set of structs to include - the top struct

Callers 1

typeFieldsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected