MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / MergeSort

Method MergeSort

query/outputnode.go:143–153  ·  view source on GitHub ↗

Sort the given fastJson list

(headRef *fastJsonNode)

Source from the content-addressed store, hash-verified

141
142// Sort the given fastJson list
143func (enc *encoder) MergeSort(headRef *fastJsonNode) {
144 if headRef == nil || (*headRef).next == nil {
145 return
146 }
147
148 var a, b fastJsonNode
149 frontBackSplit(*headRef, &a, &b)
150 enc.MergeSort(&a)
151 enc.MergeSort(&b)
152 *headRef = enc.mergeSortedLists(a, b)
153}
154
155func (enc *encoder) mergeSortedLists(a fastJsonNode, b fastJsonNode) fastJsonNode {
156 var result fastJsonNode

Callers 1

normalizeMethod · 0.95

Calls 2

mergeSortedListsMethod · 0.95
frontBackSplitFunction · 0.85

Tested by

no test coverage detected