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

Method mergeSortedLists

query/outputnode.go:155–172  ·  view source on GitHub ↗
(a fastJsonNode, b fastJsonNode)

Source from the content-addressed store, hash-verified

153}
154
155func (enc *encoder) mergeSortedLists(a fastJsonNode, b fastJsonNode) fastJsonNode {
156 var result fastJsonNode
157
158 if a == nil {
159 return b
160 } else if b == nil {
161 return a
162 }
163
164 if enc.less(a, b) {
165 result = a
166 result.next = enc.mergeSortedLists(a.next, b)
167 } else {
168 result = b
169 result.next = enc.mergeSortedLists(a, b.next)
170 }
171 return result
172}
173
174func (enc *encoder) less(i fastJsonNode, j fastJsonNode) bool {
175 attri := enc.getAttr(i)

Callers 1

MergeSortMethod · 0.95

Calls 1

lessMethod · 0.95

Tested by

no test coverage detected