iadd adds the arg i, returning true if not already present
(i uint16)
| 373 | |
| 374 | // iadd adds the arg i, returning true if not already present |
| 375 | func (bc *bitmapContainer) iadd(i uint16) bool { |
| 376 | x := int(i) |
| 377 | previous := bc.bitmap[x/64] |
| 378 | mask := uint64(1) << (uint(x) % 64) |
| 379 | newb := previous | mask |
| 380 | bc.bitmap[x/64] = newb |
| 381 | bc.cardinality += int((previous ^ newb) >> (uint(x) % 64)) |
| 382 | return newb != previous |
| 383 | } |
| 384 | |
| 385 | func (bc *bitmapContainer) iremoveReturnMinimized(i uint16) container { |
| 386 | if bc.iremove(i) { |