MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / Contains

Method Contains

roaring64/roaring64.go:305–309  ·  view source on GitHub ↗

Contains returns true if the integer is contained in the bitmap

(x uint64)

Source from the content-addressed store, hash-verified

303
304// Contains returns true if the integer is contained in the bitmap
305func (rb *Bitmap) Contains(x uint64) bool {
306 hb := highbits(x)
307 c := rb.highlowcontainer.getContainer(hb)
308 return c != nil && c.Contains(lowbits(x))
309}
310
311// ContainsInt returns true if the integer is contained in the bitmap (this is a convenience method, the parameter is casted to uint64 and Contains is called)
312func (rb *Bitmap) ContainsInt(x int) bool {

Callers 15

ContainsIntMethod · 0.95
TestIssue386Function · 0.95
TestCloneOfCOWFunction · 0.95
TestCloneOfCOWRangeFunction · 0.95
TestBitmapCOWFunction · 0.95
TestBitmapFunction · 0.95
TestOrCOWSharedContainerFunction · 0.45
ValueExistsMethod · 0.45
IsNegativeMethod · 0.45
GetBigValueMethod · 0.45

Calls 3

highbitsFunction · 0.70
lowbitsFunction · 0.70
getContainerMethod · 0.45

Tested by 11

TestIssue386Function · 0.76
TestCloneOfCOWFunction · 0.76
TestCloneOfCOWRangeFunction · 0.76
TestBitmapCOWFunction · 0.76
TestBitmapFunction · 0.76
TestOrCOWSharedContainerFunction · 0.36
TestCopiesFunction · 0.36
TestIssue266Function · 0.36
Test64BitValuesFunction · 0.36