FromEncodingParts creates a bit array from the encoding parts.
(words []uint64, lastBitsUsed uint64)
| 503 | |
| 504 | // FromEncodingParts creates a bit array from the encoding parts. |
| 505 | func 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. |
| 518 | func mustFromEncodingParts(words []uint64, lastBitsUsed uint64) BitArray { |
no test coverage detected