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

Function encodingModeForIdx

pkg/util/json/encode.go:80–85  ·  view source on GitHub ↗

encodingModeForIdx determines which encoding mode we choose to use for a given i-th entry in an array or object.

(i int, offset uint32)

Source from the content-addressed store, hash-verified

78// encodingModeForIdx determines which encoding mode we choose to use for a
79// given i-th entry in an array or object.
80func encodingModeForIdx(i int, offset uint32) encodingMode {
81 if i%offlenStride == 0 {
82 return offsetEncode(offset)
83 }
84 return lengthMode
85}
86
87func (j jsonArray) encode(appendTo []byte) (e jEntry, b []byte, err error) {
88 encodingStartPosition := len(appendTo)

Callers 2

encodeMethod · 0.85
encodeMethod · 0.85

Calls 1

offsetEncodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…