clarify bsi-building preconditions

This commit is contained in:
Nia Weiss 2020-11-20 12:38:53 -05:00
parent f9c196e418
commit 410a372351
No known key found for this signature in database
GPG key ID: 895E83409BFDA1BB

3
bsi.go
View file

@ -220,6 +220,7 @@ func (b *rowBuilder) flushKey() {
}
// Add a value to the bitmap.
// Values must be added sequentially.
func (b *rowBuilder) Add(v uint64) {
vkey := v / (1 << 16)
if b.key != vkey {
@ -270,7 +271,7 @@ func (b *rowBuilder) Build() *Row {
type bsiBuilder []rowBuilder
// Insert a value into the BSI data.
// It is assumed that it did not previously exist.
// Columns must be inserted sequentially, and duplicates are not allowed.
func (b *bsiBuilder) Insert(col, val uint64) {
for val != 0 {
i := bits.TrailingZeros64(val)