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

Method Normalize

cpp/src/arrow/util/rle_bitmap_internal.h:62–68  ·  view source on GitHub ↗

Ensure `bit_start` always ends up in [0, 8[, even when it starts negative.

Source from the content-addressed store, hash-verified

60
61 /// Ensure `bit_start` always ends up in [0, 8[, even when it starts negative.
62 constexpr void Normalize() {
63 // On two's-complement targets an arithmetic right shift floors, and the AND mask
64 // yields the non-negative remainder (e.g. -1 -> byte -1, offset 7), unlike `/` and
65 // `%` which truncate toward zero.
66 data_ += bit_start_ >> 3;
67 bit_start_ &= 0b0111;
68 }
69};
70
71using BitmapSpanMut = BitmapSpan<uint8_t>;

Callers 1

NewStartingAtMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected