Remove the integer x from the bitmap
(x uint32)
| 1208 | |
| 1209 | // Remove the integer x from the bitmap |
| 1210 | func (rb *Bitmap) Remove(x uint32) { |
| 1211 | hb := highbits(x) |
| 1212 | i := rb.highlowcontainer.getIndex(hb) |
| 1213 | if i >= 0 { |
| 1214 | c := rb.highlowcontainer.getWritableContainerAtIndex(i).iremoveReturnMinimized(lowbits(x)) |
| 1215 | rb.highlowcontainer.setContainerAtIndex(i, c) |
| 1216 | if rb.highlowcontainer.getContainerAtIndex(i).isEmpty() { |
| 1217 | rb.highlowcontainer.removeAtIndex(i) |
| 1218 | } |
| 1219 | } |
| 1220 | } |
| 1221 | |
| 1222 | // CheckedRemove removes the integer x from the bitmap and return true if the integer was effectively removed (and false if the integer was not present) |
| 1223 | func (rb *Bitmap) CheckedRemove(x uint32) bool { |