FromEncodingParts creates a bit array from the encoding parts.
(words []uint64, lastBitsUsed uint64)
| 489 | |
| 490 | // FromEncodingParts creates a bit array from the encoding parts. |
| 491 | func FromEncodingParts(words []uint64, lastBitsUsed uint64) (BitArray, error) { |
| 492 | if lastBitsUsed > numBitsPerWord { |
| 493 | err := fmt.Errorf("FromEncodingParts: lastBitsUsed must not exceed %d, got %d", |
| 494 | errors.Safe(numBitsPerWord), errors.Safe(lastBitsUsed)) |
| 495 | return BitArray{}, pgerror.WithCandidateCode(err, pgcode.InvalidParameterValue) |
| 496 | } |
| 497 | return BitArray{ |
| 498 | words: words, |
| 499 | lastBitsUsed: uint8(lastBitsUsed), |
| 500 | }, nil |
| 501 | } |
| 502 | |
| 503 | // mustFromEncodingParts is like FromEncodingParts but errors cause a panic. |
| 504 | func mustFromEncodingParts(words []uint64, lastBitsUsed uint64) BitArray { |
no test coverage detected
searching dependent graphs…