| 426 | |
| 427 | template <typename VisitNotNull, typename VisitNull> |
| 428 | static Status VisitBitBlocks(const uint8_t* bitmap, int64_t offset, int64_t length, |
| 429 | VisitNotNull&& visit_not_null, VisitNull&& visit_null) { |
| 430 | internal::OptionalBitBlockCounter bit_counter(bitmap, offset, length); |
| 431 | int64_t position = 0; |
| 432 | while (position < length) { |
| 433 | internal::BitBlockCount block = bit_counter.NextBlock(); |
| 434 | if (block.AllSet()) { |
| 435 | for (int64_t i = 0; i < block.length; ++i, ++position) { |
| 436 | ARROW_RETURN_NOT_OK(visit_not_null(position)); |
| 437 | } |
| 438 | } else if (block.NoneSet()) { |
| 439 | for (int64_t i = 0; i < block.length; ++i, ++position) { |
| 440 | ARROW_RETURN_NOT_OK(visit_null()); |
| 441 | } |
| 442 | } else { |
| 443 | for (int64_t i = 0; i < block.length; ++i, ++position) { |
| 444 | if (bit_util::GetBit(bitmap, offset + position)) { |
| 445 | ARROW_RETURN_NOT_OK(visit_not_null(position)); |
| 446 | } else { |
| 447 | ARROW_RETURN_NOT_OK(visit_null()); |
| 448 | } |
| 449 | } |
| 450 | } |
| 451 | } |
| 452 | return Status::OK(); |
| 453 | } |
| 454 | |
| 455 | template <typename VisitNotNull, typename VisitNull> |
| 456 | static void VisitBitBlocksVoid(const uint8_t* bitmap, int64_t offset, int64_t length, |
no test coverage detected