MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / getJEntryAt

Function getJEntryAt

pkg/util/json/jentry.go:82–95  ·  view source on GitHub ↗
(b []byte, idx int, offset int)

Source from the content-addressed store, hash-verified

80}
81
82func getJEntryAt(b []byte, idx int, offset int) (jEntry, error) {
83 enc, err := getUint32At(b, idx)
84 if err != nil {
85 return jEntry{}, err
86 }
87 length := enc & jEntryOffLenMask
88 if (enc & jEntryIsOffFlag) != 0 {
89 length -= uint32(offset)
90 }
91 return jEntry{
92 length: length,
93 typCode: enc & jEntryTypeMask,
94 }, nil
95}
96
97// decodeJEntry decodes a 4-byte JEntry from a buffer. The current offset is
98// required because a JEntry can either encode a length or an offset, and while

Callers 4

nextEncodedMethod · 0.85
nextEncodedMethod · 0.85
iterObjectMethod · 0.85
nthJEntryMethod · 0.85

Calls 1

getUint32AtFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…