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

Method SetUID

query/outputnode.go:522–540  ·  view source on GitHub ↗
(fj fastJsonNode, uid uint64, attr uint16)

Source from the content-addressed store, hash-verified

520}
521
522func (enc *encoder) SetUID(fj fastJsonNode, uid uint64, attr uint16) error {
523 // if we're in debug mode, uid may be added second time, skip this
524 if attr == enc.uidAttr {
525 fjAttrs := enc.children(fj)
526 for fjAttrs != nil {
527 if enc.getAttr(fjAttrs) == attr {
528 return nil
529 }
530 fjAttrs = fjAttrs.next
531 }
532 }
533
534 un, err := enc.makeUidNode(attr, uid)
535 if err != nil {
536 return err
537 }
538 enc.addChildren(fj, un)
539 return nil
540}
541
542func (enc *encoder) IsEmpty(fj fastJsonNode) bool {
543 return fj.child == nil

Callers 1

preTraverseMethod · 0.80

Calls 4

childrenMethod · 0.95
getAttrMethod · 0.95
makeUidNodeMethod · 0.95
addChildrenMethod · 0.95

Tested by

no test coverage detected