| 525 | |
| 526 | template <typename VisitNotNull, typename VisitNull> |
| 527 | static void VisitTwoBitBlocksVoid(const uint8_t* left_bitmap, int64_t left_offset, |
| 528 | const uint8_t* right_bitmap, int64_t right_offset, |
| 529 | int64_t length, VisitNotNull&& visit_not_null, |
| 530 | VisitNull&& visit_null) { |
| 531 | if (left_bitmap == NULLPTR || right_bitmap == NULLPTR) { |
| 532 | // At most one bitmap is present |
| 533 | if (left_bitmap == NULLPTR) { |
| 534 | return VisitBitBlocksVoid(right_bitmap, right_offset, length, |
| 535 | std::forward<VisitNotNull>(visit_not_null), |
| 536 | std::forward<VisitNull>(visit_null)); |
| 537 | } else { |
| 538 | return VisitBitBlocksVoid(left_bitmap, left_offset, length, |
| 539 | std::forward<VisitNotNull>(visit_not_null), |
| 540 | std::forward<VisitNull>(visit_null)); |
| 541 | } |
| 542 | } |
| 543 | BinaryBitBlockCounter bit_counter(left_bitmap, left_offset, right_bitmap, right_offset, |
| 544 | length); |
| 545 | int64_t position = 0; |
| 546 | while (position < length) { |
| 547 | BitBlockCount block = bit_counter.NextAndWord(); |
| 548 | if (block.AllSet()) { |
| 549 | for (int64_t i = 0; i < block.length; ++i, ++position) { |
| 550 | visit_not_null(position); |
| 551 | } |
| 552 | } else if (block.NoneSet()) { |
| 553 | for (int64_t i = 0; i < block.length; ++i, ++position) { |
| 554 | visit_null(); |
| 555 | } |
| 556 | } else { |
| 557 | for (int64_t i = 0; i < block.length; ++i, ++position) { |
| 558 | if (bit_util::GetBit(left_bitmap, left_offset + position) && |
| 559 | bit_util::GetBit(right_bitmap, right_offset + position)) { |
| 560 | visit_not_null(position); |
| 561 | } else { |
| 562 | visit_null(); |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | } // namespace internal |
| 570 | } // namespace arrow |
no test coverage detected