func (b *builder) unsafeAppendBoolsToBitmap(valid []bool, length int) {
	if len(valid) == 0 {
		b.unsafeSetValid(length)
		return
	}

	byteOffset := b.length / 8
	bitOffset := byte(b.length % 8)
	nullBitmap := b.nullBitmap.Bytes()
	bitSet := nullBitmap[byteOffset]

	for _, v := range valid {
		if bitOffset == 8 {
			bitOffset = 0
			nullBitmap[byteOffset] = bitSet
			byteOffset++
			bitSet = nullBitmap[byteOffset]
		}

		if v {
			bitSet |= bitutil.BitMask[bitOffset]
		} else {
			bitSet &= bitutil.FlippedBitMask[bitOffset]
			b.nullN++
		}
		bitOffset++
	}

	if bitOffset != 0 {
		nullBitmap[byteOffset] = bitSet
	}
	b.length += len(valid)
}
// unsafeAppendBoolsToBitmap appends the contents of valid to the validity bitmap.
// As an optimization, if the valid slice is empty, the next length bits will be set to valid (not null).
unsafeAppendBoolsToBitmap appends the contents of valid to the validity bitmap.
As an optimization, if the valid slice is empty, the next length bits will be set to valid (not null).
// unsafeAppendBoolsToBitmap appends the contents of valid to the validity bitmap . // As an optimization if the valid slice is empty the next length bits will be set to valid ( not null ) .
func (b *builder) unsafeAppendBoolsToBitmap(valid []bool, length int) {
	if len(valid) == 0 {
		b.unsafeSetValid(length)
		return
	}
	byteOffset := b.length / 8
	bitOffset := byte(b.length % 8)
	nullBitmap := b.nullBitmap.Bytes()
	bitSet := nullBitmap[byteOffset]
	for _, v := range valid {
		if bitOffset == 8 {
			bitOffset = 0
			nullBitmap[byteOffset] = bitSet
			byteOffset++
			bitSet = nullBitmap[byteOffset]
		}
		if v {
			bitSet |= bitutil.BitMask[bitOffset]
		} else {
			bitSet &= bitutil.FlippedBitMask[bitOffset]
			b.nullN++
		}
		bitOffset++
	}
	if bitOffset != 0 {
		nullBitmap[byteOffset] = bitSet
	}
	b.length += len(valid)
}
func ( b * builder ) unsafeAppendBoolsToBitmap ( valid [ ] bool , length int ) { if len ( valid ) == 0 { b . unsafeSetValid ( length ) return } byteOffset := b . length / 8 bitOffset := byte ( b . length % 8 ) nullBitmap := b . nullBitmap . Bytes ( ) bitSet := nullBitmap [ byteOffset ] for _ , v := range valid { if bitOffset == 8 { bitOffset = 0 nullBitmap [ byteOffset ] = bitSet byteOffset ++ bitSet = nullBitmap [ byteOffset ] } if v { bitSet |= bitutil . BitMask [ bitOffset ] } else { bitSet &= bitutil . FlippedBitMask [ bitOffset ] b . nullN ++ } bitOffset ++ } if bitOffset != 0 { nullBitmap [ byteOffset ] = bitSet } b . length += len ( valid ) }
unsafeAppendBoolsToBitmap appends the contents of valid to the validity bitmap.
unsafeAppendBoolsToBitmap appends the contents of valid to the validity bitmap .