MCPcopy Create free account
hub / github.com/dolthub/doltgresql / FromEncodingParts

Function FromEncodingParts

postgres/parser/utils/bitarray.go:505–515  ·  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

503
504// FromEncodingParts creates a bit array from the encoding parts.
505func FromEncodingParts(words []uint64, lastBitsUsed uint64) (BitArray, error) {
506 if lastBitsUsed > numBitsPerWord {
507 err := fmt.Errorf("FromEncodingParts: lastBitsUsed must not exceed %d, got %d",
508 errors.Safe(numBitsPerWord), errors.Safe(lastBitsUsed))
509 return BitArray{}, pgerror.WithCandidateCode(err, pgcode.InvalidParameterValue)
510 }
511 return BitArray{
512 words: words,
513 lastBitsUsed: uint8(lastBitsUsed),
514 }, nil
515}
516
517// mustFromEncodingParts is like FromEncodingParts but errors cause a panic.
518func mustFromEncodingParts(words []uint64, lastBitsUsed uint64) BitArray {

Callers 2

ParseFunction · 0.85
mustFromEncodingPartsFunction · 0.85

Calls 2

WithCandidateCodeFunction · 0.92
ErrorfMethod · 0.65

Tested by

no test coverage detected