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