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

Function encodingModeForIdx

pkg/util/json/encode.go:74–79  ·  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

72// encodingModeForIdx determines which encoding mode we choose to use for a
73// given i-th entry in an array or object.
74func encodingModeForIdx(i int, offset uint32) encodingMode {
75 if i%offlenStride == 0 {
76 return offsetEncode(offset)
77 }
78 return lengthMode
79}
80
81func (j jsonArray) encode(appendTo []byte) (e jEntry, b []byte, err error) {
82 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…