File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -819,6 +819,9 @@ func (rb *Bitmap) Maximum() uint32 {
819
819
820
820
// Contains returns true if the integer is contained in the bitmap
821
821
func (rb * Bitmap ) Contains (x uint32 ) bool {
822
+ if rb .IsEmpty () {
823
+ return false
824
+ }
822
825
hb := highbits (x )
823
826
c := rb .highlowcontainer .getContainer (hb )
824
827
return c != nil && c .contains (lowbits (x ))
Original file line number Diff line number Diff line change @@ -313,6 +313,9 @@ func (rb *Bitmap) Maximum() uint64 {
313
313
314
314
// Contains returns true if the integer is contained in the bitmap
315
315
func (rb * Bitmap ) Contains (x uint64 ) bool {
316
+ if rb .IsEmpty () {
317
+ return false
318
+ }
316
319
hb := highbits (x )
317
320
c := rb .highlowcontainer .getContainer (hb )
318
321
return c != nil && c .Contains (lowbits (x ))
You can’t perform that action at this time.
0 commit comments