add the integer x to the bitmap, return the container and its index
(x uint32)
| 1169 | |
| 1170 | // add the integer x to the bitmap, return the container and its index |
| 1171 | func (rb *Bitmap) addwithptr(x uint32) (int, container) { |
| 1172 | hb := highbits(x) |
| 1173 | ra := &rb.highlowcontainer |
| 1174 | i := ra.getIndex(hb) |
| 1175 | var c container |
| 1176 | if i >= 0 { |
| 1177 | c = ra.getWritableContainerAtIndex(i).iaddReturnMinimized(lowbits(x)) |
| 1178 | rb.highlowcontainer.setContainerAtIndex(i, c) |
| 1179 | return i, c |
| 1180 | } |
| 1181 | newac := newArrayContainer() |
| 1182 | c = newac.iaddReturnMinimized(lowbits(x)) |
| 1183 | rb.highlowcontainer.insertNewKeyValueAt(-i-1, hb, c) |
| 1184 | return -i - 1, c |
| 1185 | } |
| 1186 | |
| 1187 | // CheckedAdd adds the integer x to the bitmap and return true if it was added (false if the integer was already present) |
| 1188 | func (rb *Bitmap) CheckedAdd(x uint32) bool { |
no test coverage detected