MCPcopy Create free account
hub / github.com/dolthub/doltgresql / encodingModeForIdx

Function encodingModeForIdx

postgres/parser/json/encode.go:94–99  ·  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

92// encodingModeForIdx determines which encoding mode we choose to use for a
93// given i-th entry in an array or object.
94func encodingModeForIdx(i int, offset uint32) encodingMode {
95 if i%offlenStride == 0 {
96 return offsetEncode(offset)
97 }
98 return lengthMode
99}
100
101func (j jsonArray) encode(appendTo []byte) (e jEntry, b []byte, err error) {
102 encodingStartPosition := len(appendTo)

Callers 2

encodeMethod · 0.85
encodeMethod · 0.85

Calls 1

offsetEncodeFunction · 0.85

Tested by

no test coverage detected