MCPcopy
hub / github.com/RoaringBitmap/roaring / Contains

Method Contains

roaring.go:1060–1064  ·  view source on GitHub ↗

Contains returns true if the integer is contained in the bitmap

(x uint32)

Source from the content-addressed store, hash-verified

1058
1059// Contains returns true if the integer is contained in the bitmap
1060func (rb *Bitmap) Contains(x uint32) bool {
1061 hb := highbits(x)
1062 c := rb.highlowcontainer.getContainer(hb)
1063 return c != nil && c.contains(lowbits(x))
1064}
1065
1066// ContainsInt returns true if the integer is contained in the bitmap (this is a convenience method, the parameter is casted to uint32 and Contains is called)
1067func (rb *Bitmap) ContainsInt(x int) bool {

Callers 15

ContainsIntMethod · 0.95
TestIssue386Function · 0.95
TestCloneOfCOWFunction · 0.95
TestBitmapCOWFunction · 0.95
TestBitmapFunction · 0.95
BenchmarkGetTestRoaringFunction · 0.95
BenchmarkSparseContainsFunction · 0.95
TestExample_roaring060Function · 0.45
TestExample2_roaring061Function · 0.45
smatActionFunction · 0.45
checkEqualsMethod · 0.45
AndMethod · 0.45

Calls 4

highbitsFunction · 0.70
lowbitsFunction · 0.70
containsMethod · 0.65
getContainerMethod · 0.45

Tested by 9

TestIssue386Function · 0.76
TestCloneOfCOWFunction · 0.76
TestBitmapCOWFunction · 0.76
TestBitmapFunction · 0.76
BenchmarkGetTestRoaringFunction · 0.76
BenchmarkSparseContainsFunction · 0.76
TestExample_roaring060Function · 0.36
TestExample2_roaring061Function · 0.36
TestUnsetFunction · 0.36