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

Function DecodeUntaggedBitArrayValue

pkg/util/encoding/encoding.go:2252–2269  ·  view source on GitHub ↗

DecodeUntaggedBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.

(b []byte)

Source from the content-addressed store, hash-verified

2250
2251// DecodeUntaggedBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.
2252func DecodeUntaggedBitArrayValue(b []byte) (remaining []byte, d bitarray.BitArray, err error) {
2253 var bitLen uint64
2254 b, _, bitLen, err = DecodeNonsortingUvarint(b)
2255 if err != nil {
2256 return b, bitarray.BitArray{}, err
2257 }
2258 words, lastBitsUsed := bitarray.EncodingPartsForBitLen(uint(bitLen))
2259 for i := range words {
2260 var val uint64
2261 b, val, err = DecodeUint64Ascending(b)
2262 if err != nil {
2263 return b, bitarray.BitArray{}, err
2264 }
2265 words[i] = val
2266 }
2267 ba, err := bitarray.FromEncodingParts(words, lastBitsUsed)
2268 return b, ba, err
2269}
2270
2271const uuidValueEncodedLength = 16
2272

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…