AddMany add all of the values in dat
(dat []uint32)
| 1927 | |
| 1928 | // AddMany add all of the values in dat |
| 1929 | func (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 |
| 1947 | func BitmapOf(dat ...uint32) *Bitmap { |