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

Function destUids

worker/sort.go:566–580  ·  view source on GitHub ↗
(uidMatrix []*pb.List)

Source from the content-addressed store, hash-verified

564}
565
566func destUids(uidMatrix []*pb.List) *pb.List {
567 included := make(map[uint64]struct{})
568 for _, ul := range uidMatrix {
569 for _, uid := range ul.Uids {
570 included[uid] = struct{}{}
571 }
572 }
573
574 res := &pb.List{Uids: make([]uint64, 0, len(included))}
575 for uid := range included {
576 res.Uids = append(res.Uids, uid)
577 }
578 sort.Slice(res.Uids, func(i, j int) bool { return res.Uids[i] < res.Uids[j] })
579 return res
580}
581
582func fetchValues(ctx context.Context, in *pb.Query, idx int, or chan orderResult) {
583 var err error

Callers 1

multiSortFunction · 0.85

Calls 1

SliceMethod · 0.80

Tested by

no test coverage detected