@@ -318,7 +318,7 @@ func (b *BSI) CompareBigValue(parallelism int, op Operation, valueOrStart, end *
318
318
if valueOrStart == nil {
319
319
valueOrStart = b .MinMaxBig (parallelism , MIN , & b .eBM )
320
320
}
321
- if end == nil {
321
+ if end == nil && op == RANGE {
322
322
end = b .MinMaxBig (parallelism , MAX , & b .eBM )
323
323
}
324
324
@@ -386,7 +386,10 @@ func compareValue(e *task, batch []uint64, resultsChan chan *Bitmap, wg *sync.Wa
386
386
}
387
387
388
388
startIsNegative := e .valueOrStart .Sign () == - 1
389
- endIsNegative := e .end .Sign () == - 1
389
+ endIsNegative := true
390
+ if e .end != nil {
391
+ endIsNegative = e .end .Sign () == - 1
392
+ }
390
393
391
394
for i := 0 ; i < len (batch ); i ++ {
392
395
cID := batch [i ]
@@ -399,7 +402,7 @@ func compareValue(e *task, batch []uint64, resultsChan chan *Bitmap, wg *sync.Wa
399
402
if isNegative != startIsNegative {
400
403
compStartValue = twosComplement (e .valueOrStart , e .bsi .BitCount ()+ 1 )
401
404
}
402
- if isNegative != endIsNegative {
405
+ if isNegative != endIsNegative && e . end != nil {
403
406
compEndValue = twosComplement (e .end , e .bsi .BitCount ()+ 1 )
404
407
}
405
408
@@ -735,12 +738,12 @@ func (b *BSI) ParOr(parallelism int, bsis ...*BSI) {
735
738
bits := len (b .bA )
736
739
for i := 0 ; i < len (bsis ); i ++ {
737
740
if len (bsis [i ].bA ) > bits {
738
- bits = bsis [i ].BitCount ( )
741
+ bits = len ( bsis [i ].bA )
739
742
}
740
743
}
741
744
742
745
// Make sure we have enough bit slices
743
- for bits > b . BitCount ( ) {
746
+ for bits > len ( b . bA ) {
744
747
bm := Bitmap {}
745
748
bm .RunOptimize ()
746
749
b .bA = append (b .bA , bm )
0 commit comments