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

Method NextTrailingByte

cpp/src/arrow/util/bitmap_reader.h:199–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197 }
198
199 uint8_t NextTrailingByte(int& valid_bits) {
200 uint8_t byte;
201 assert(trailing_bits_ > 0);
202
203 if (trailing_bits_ <= 8) {
204 // last byte
205 valid_bits = trailing_bits_;
206 trailing_bits_ = 0;
207 byte = 0;
208 internal::BitmapReader reader(bitmap_, offset_, valid_bits);
209 for (int i = 0; i < valid_bits; ++i) {
210 byte >>= 1;
211 if (reader.IsSet()) {
212 byte |= 0x80;
213 }
214 reader.Next();
215 }
216 byte >>= (8 - valid_bits);
217 } else {
218 ++bitmap_;
219 const uint8_t next_byte = load<uint8_t>(bitmap_);
220 byte = current_data.epi.byte_;
221 if (may_have_byte_offset && offset_) {
222 byte >>= offset_;
223 byte |= next_byte << (8 - offset_);
224 }
225 current_data.epi.byte_ = next_byte;
226 trailing_bits_ -= 8;
227 trailing_bytes_--;
228 valid_bits = 8;
229 }
230 return byte;
231 }
232
233 int64_t words() const { return nwords_; }
234 int trailing_bytes() const { return trailing_bytes_; }

Callers 7

MurmurHashBitmap64Function · 0.80
BitmapWordReaderBenchFunction · 0.80
TransferBitmapFunction · 0.80
BitmapEqualsFunction · 0.80
UnalignedBitmapOpFunction · 0.80
RunIfElseLoopFunction · 0.80

Calls 2

IsSetMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected