| 512 | |
| 513 | template <typename Visit> |
| 514 | inline void VisitSetBitRunsVoid(const uint8_t* bitmap, int64_t offset, int64_t length, |
| 515 | Visit&& visit) { |
| 516 | if (bitmap == NULLPTR) { |
| 517 | // Assuming all set (as in a null bitmap) |
| 518 | visit(static_cast<int64_t>(0), static_cast<int64_t>(length)); |
| 519 | return; |
| 520 | } |
| 521 | SetBitRunReader reader(bitmap, offset, length); |
| 522 | while (true) { |
| 523 | const auto run = reader.NextRun(); |
| 524 | if (run.length == 0) { |
| 525 | break; |
| 526 | } |
| 527 | visit(run.position, run.length); |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | template <typename Visit> |
| 532 | inline Status VisitSetBitRuns(const std::shared_ptr<Buffer>& bitmap, int64_t offset, |
no test coverage detected