MCPcopy
hub / github.com/dgraph-io/dgraph / internalMergeSort

Function internalMergeSort

algo/uidlist.go:436–446  ·  view source on GitHub ↗

MergeSorted merges sorted lists.

(lists []*pb.List)

Source from the content-addressed store, hash-verified

434
435// MergeSorted merges sorted lists.
436func internalMergeSort(lists []*pb.List) *pb.List {
437 sz := 0
438 for _, l := range lists {
439 if l == nil || len(l.Uids) == 0 {
440 continue
441 }
442 sz += len(l.Uids)
443 }
444 buffer := make([]uint64, 0, sz)
445 return internalMergeSortWithBuffer(lists, buffer)
446}
447
448func MergeSorted(lists []*pb.List) *pb.List {
449 // Calculate total capacity needed

Callers 4

MergeSortedMoreMemFunction · 0.85
mergeSortedWithBufferFunction · 0.85
BenchmarkMergeSortedFunction · 0.85
TestMergeSortedRandomFunction · 0.85

Calls 1

Tested by 2

BenchmarkMergeSortedFunction · 0.68
TestMergeSortedRandomFunction · 0.68