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

Function DecodeUntaggedBitArrayValue

pkg/util/encoding/encoding.go:3133–3150  ·  view source on GitHub ↗

DecodeUntaggedBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.

(b []byte)

Source from the content-addressed store, hash-verified

3131
3132// DecodeUntaggedBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.
3133func DecodeUntaggedBitArrayValue(b []byte) (remaining []byte, d bitarray.BitArray, err error) {
3134 var bitLen uint64
3135 b, _, bitLen, err = DecodeNonsortingUvarint(b)
3136 if err != nil {
3137 return b, bitarray.BitArray{}, err
3138 }
3139 words, lastBitsUsed := bitarray.EncodingPartsForBitLen(uint(bitLen))
3140 for i := range words {
3141 var val uint64
3142 b, val, err = DecodeUint64Ascending(b)
3143 if err != nil {
3144 return b, bitarray.BitArray{}, err
3145 }
3146 words[i] = val
3147 }
3148 ba, err := bitarray.FromEncodingParts(words, lastBitsUsed)
3149 return b, ba, err
3150}
3151
3152const uuidValueEncodedLength = 16
3153

Callers 1

DecodeBitArrayValueFunction · 0.85

Calls 4

EncodingPartsForBitLenFunction · 0.92
FromEncodingPartsFunction · 0.92
DecodeNonsortingUvarintFunction · 0.85
DecodeUint64AscendingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…