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

Function FromEncodingParts

pkg/util/bitarray/bitarray.go:529–539  ·  view source on GitHub ↗

FromEncodingParts creates a bit array from the encoding parts.

(words []uint64, lastBitsUsed uint64)

Source from the content-addressed store, hash-verified

527
528// FromEncodingParts creates a bit array from the encoding parts.
529func FromEncodingParts(words []uint64, lastBitsUsed uint64) (BitArray, error) {
530 if lastBitsUsed > numBitsPerWord {
531 err := fmt.Errorf("FromEncodingParts: lastBitsUsed must not exceed %d, got %d",
532 errors.Safe(numBitsPerWord), errors.Safe(lastBitsUsed))
533 return BitArray{}, pgerror.WithCandidateCode(err, pgcode.InvalidParameterValue)
534 }
535 return BitArray{
536 words: words,
537 lastBitsUsed: uint8(lastBitsUsed),
538 }, nil
539}
540
541// mustFromEncodingParts is like FromEncodingParts but errors cause a panic.
542func mustFromEncodingParts(words []uint64, lastBitsUsed uint64) BitArray {

Callers 6

DecodeBitArrayAscendingFunction · 0.92
DecodeBitArrayDescendingFunction · 0.92
parseFromBinaryFunction · 0.85
parseFromHexFunction · 0.85
mustFromEncodingPartsFunction · 0.85

Calls 2

WithCandidateCodeFunction · 0.92
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…