mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
bug in Union
This commit is contained in:
parent
d699d41ea7
commit
72db5500ca
1 changed files with 2 additions and 3 deletions
|
|
@ -86,13 +86,12 @@ func (b *Bitmap) Intersect(other *Bitmap) *Bitmap {
|
|||
// Union returns the bitwise union of b and other.
|
||||
func (b *Bitmap) Union(other *Bitmap) *Bitmap {
|
||||
var segments []BitmapSegment
|
||||
|
||||
itr := newMergeSegmentIterator(b.segments, other.segments)
|
||||
for s0, s1 := itr.next(); s0 != nil || s1 != nil; s0, s1 = itr.next() {
|
||||
if s0 == nil {
|
||||
if s1 == nil {
|
||||
segments = append(segments, *s0)
|
||||
continue
|
||||
} else if s1 == nil {
|
||||
} else if s0 == nil {
|
||||
segments = append(segments, *s1)
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue