()
| 470 | } |
| 471 | |
| 472 | func (ra *roaringArray) headerSize() uint64 { |
| 473 | size := uint64(len(ra.keys)) |
| 474 | if ra.hasRunCompression() { |
| 475 | if size < noOffsetThreshold { // for small bitmaps, we omit the offsets |
| 476 | return 4 + (size+7)/8 + 4*size |
| 477 | } |
| 478 | return 4 + (size+7)/8 + 8*size // - 4 because we pack the size with the cookie |
| 479 | } |
| 480 | return 4 + 4 + 8*size |
| 481 | } |
| 482 | |
| 483 | // should be dirt cheap |
| 484 | func (ra *roaringArray) serializedSizeInBytes() uint64 { |
no test coverage detected