mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
fix bitmap.BitwiseEqual bugs
bitmap.BitwiseEqual had a couple of subtle bugs, and the net result is that if the bitmap you were comparing to had an empty container after the original bitmap ran out of containers, we'd spuriously report the container as existing and being... the last container in the original, actually. Issues are both that we were grabbing the value from the wrong iterator, and also that we were iterating twice per loop, and thus could also have missed a non-empty container immediately following an empty one.
This commit is contained in:
parent
f1f7bd6327
commit
77f4ff1cfd
1 changed files with 1 additions and 3 deletions
|
|
@ -6470,16 +6470,14 @@ func (b *Bitmap) BitwiseEqual(c *Bitmap) (bool, error) {
|
|||
bct++
|
||||
break
|
||||
}
|
||||
bn = biter.Next()
|
||||
}
|
||||
for cn {
|
||||
cn = citer.Next()
|
||||
ck, cc = biter.Value()
|
||||
ck, cc = citer.Value()
|
||||
if cc.N() != 0 {
|
||||
cct++
|
||||
break
|
||||
}
|
||||
cn = biter.Next()
|
||||
}
|
||||
if bn {
|
||||
return false, fmt.Errorf("container mismatch: %d vs %d containers, first bitmap has extra container %d [%v bits]", bct, cct, bk, bc)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue