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

Function VisitBitRuns

cpp/src/arrow/util/bit_run_reader.h:466–483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464
465template <typename Visit>
466inline Status VisitBitRuns(const uint8_t* bitmap, int64_t offset, int64_t length,
467 Visit&& visit) {
468 if (bitmap == NULLPTR) {
469 // Assuming all set (as in a null bitmap)
470 return visit(static_cast<int64_t>(0), length, true);
471 }
472 BitRunReader reader(bitmap, offset, length);
473 int64_t position = 0;
474 while (true) {
475 const auto run = reader.NextRun();
476 if (run.length == 0) {
477 break;
478 }
479 ARROW_RETURN_NOT_OK(visit(position, run.length, run.set));
480 position += run.length;
481 }
482 return Status::OK();
483}
484
485// XXX: Try to make this function small so the compiler can inline and optimize
486// the `visit` function, which is normally a hot loop with vectorizable code.

Callers 6

DecodeArrowMethod · 0.85
DecodeArrowDenseMethod · 0.85
DecodeArrowMethod · 0.85
DecodeArrowDenseMethod · 0.85
DecodeArrowDenseMethod · 0.85
DecodeArrowDenseMethod · 0.85

Calls 2

OKFunction · 0.50
NextRunMethod · 0.45

Tested by

no test coverage detected