MCPcopy Create free account
hub / github.com/apache/arrow / VisitTwoBitBlocksVoid

Function VisitTwoBitBlocksVoid

cpp/src/arrow/util/bit_block_counter.h:527–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525
526template <typename VisitNotNull, typename VisitNull>
527static 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

Callers 1

Calls 4

VisitBitBlocksVoidFunction · 0.85
NoneSetMethod · 0.80
GetBitFunction · 0.70
AllSetMethod · 0.45

Tested by

no test coverage detected