FromEncodingParts creates a bit array from the encoding parts.
(words []uint64, lastBitsUsed uint64)
| 527 | |
| 528 | // FromEncodingParts creates a bit array from the encoding parts. |
| 529 | func 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. |
| 542 | func mustFromEncodingParts(words []uint64, lastBitsUsed uint64) BitArray { |
no test coverage detected
searching dependent graphs…