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