| 488 | // - un-inline NextRun hurts 'many null' cases a bit, but improves normal cases |
| 489 | template <typename Visit> |
| 490 | inline Status VisitSetBitRuns(const uint8_t* bitmap, int64_t offset, int64_t length, |
| 491 | Visit&& visit) { |
| 492 | if (bitmap == NULLPTR) { |
| 493 | // Assuming all set (as in a null bitmap) |
| 494 | return visit(static_cast<int64_t>(0), static_cast<int64_t>(length)); |
| 495 | } |
| 496 | SetBitRunReader reader(bitmap, offset, length); |
| 497 | while (true) { |
| 498 | const auto run = reader.NextRun(); |
| 499 | if (run.length == 0) { |
| 500 | break; |
| 501 | } |
| 502 | ARROW_RETURN_NOT_OK(visit(run.position, run.length)); |
| 503 | } |
| 504 | return Status::OK(); |
| 505 | } |
| 506 | |
| 507 | template <typename Visit> |
| 508 | inline void VisitSetBitRunsVoid(const uint8_t* bitmap, int64_t offset, int64_t length, |
no test coverage detected