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

Method setScalarVal

query/outputnode.go:317–331  ·  view source on GitHub ↗
(fj fastJsonNode, sv []byte)

Source from the content-addressed store, hash-verified

315}
316
317func (enc *encoder) setScalarVal(fj fastJsonNode, sv []byte) error {
318 offset, err := enc.arena.put(sv)
319 if err != nil {
320 return err
321 }
322 fj.meta |= uint64(offset)
323
324 // Also increase curSize.
325 enc.curSize += uint64(len(sv))
326 if size := uint64(enc.alloc.Size()) + enc.curSize; size > maxEncodedSize {
327 return fmt.Errorf("estimated response size: %d is bigger than threshold: %d",
328 size, maxEncodedSize)
329 }
330 return nil
331}
332
333func (enc *encoder) setList(fj fastJsonNode, list bool) {
334 if list {

Callers 4

makeScalarNodeMethod · 0.95
makeUidNodeMethod · 0.95
makeCustomNodeMethod · 0.95
TestFastJsonNodeFunction · 0.80

Calls 3

putMethod · 0.45
SizeMethod · 0.45
ErrorfMethod · 0.45

Tested by 1

TestFastJsonNodeFunction · 0.64