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

Method AddMany

roaring.go:1929–1944  ·  view source on GitHub ↗

AddMany add all of the values in dat

(dat []uint32)

Source from the content-addressed store, hash-verified

1927
1928// AddMany add all of the values in dat
1929func (rb *Bitmap) AddMany(dat []uint32) {
1930 if len(dat) == 0 {
1931 return
1932 }
1933 prev := dat[0]
1934 idx, c := rb.addwithptr(prev)
1935 for _, i := range dat[1:] {
1936 if highbits(prev) == highbits(i) {
1937 c = c.iaddReturnMinimized(lowbits(i))
1938 rb.highlowcontainer.setContainerAtIndex(idx, c)
1939 } else {
1940 idx, c = rb.addwithptr(i)
1941 }
1942 prev = i
1943 }
1944}
1945
1946// BitmapOf generates a new bitmap filled with the specified integers
1947func BitmapOf(dat ...uint32) *Bitmap {

Callers 15

BitmapOfFunction · 0.95
TestIssue440Function · 0.95
TestIssue440_2Function · 0.95
TestIssue440_3Function · 0.95
TestIssue440_4Function · 0.95
TestIssue440_5Function · 0.95
TestRoaringBitmapAddManyFunction · 0.95
testAddOffsetFunction · 0.95
TestBitmapFunction · 0.95
TestBitMapValidationFunction · 0.95

Calls 5

addwithptrMethod · 0.95
highbitsFunction · 0.70
lowbitsFunction · 0.70
iaddReturnMinimizedMethod · 0.65
setContainerAtIndexMethod · 0.45

Tested by 14

TestIssue440Function · 0.76
TestIssue440_2Function · 0.76
TestIssue440_3Function · 0.76
TestIssue440_4Function · 0.76
TestIssue440_5Function · 0.76
TestRoaringBitmapAddManyFunction · 0.76
testAddOffsetFunction · 0.76
TestBitmapFunction · 0.76
TestBitMapValidationFunction · 0.76