Add the integer x to the bitmap
(x uint32)
| 1154 | |
| 1155 | // Add the integer x to the bitmap |
| 1156 | func (rb *Bitmap) Add(x uint32) { |
| 1157 | hb := highbits(x) |
| 1158 | ra := &rb.highlowcontainer |
| 1159 | i := ra.getIndex(hb) |
| 1160 | if i >= 0 { |
| 1161 | var c container |
| 1162 | c = ra.getWritableContainerAtIndex(i).iaddReturnMinimized(lowbits(x)) |
| 1163 | rb.highlowcontainer.setContainerAtIndex(i, c) |
| 1164 | } else { |
| 1165 | newac := newArrayContainer() |
| 1166 | rb.highlowcontainer.insertNewKeyValueAt(-i-1, hb, newac.iaddReturnMinimized(lowbits(x))) |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | // add the integer x to the bitmap, return the container and its index |
| 1171 | func (rb *Bitmap) addwithptr(x uint32) (int, container) { |