| 96 | } |
| 97 | |
| 98 | uint64_t NextWord() { |
| 99 | if (ARROW_PREDICT_TRUE(remaining_length_ >= 64 + num_carry_bits_)) { |
| 100 | // We can load a full word |
| 101 | uint64_t next_word = LoadFullWord(); |
| 102 | // Carry bits come first, then the (64 - num_carry_bits_) LSBs from next_word |
| 103 | uint64_t word = carry_bits_ | (next_word << num_carry_bits_); |
| 104 | carry_bits_ = next_word >> (64 - num_carry_bits_); |
| 105 | remaining_length_ -= 64; |
| 106 | return word; |
| 107 | } else if (remaining_length_ > num_carry_bits_) { |
| 108 | // We can load a partial word |
| 109 | uint64_t next_word = |
| 110 | LoadPartialWord(/*bit_offset=*/0, remaining_length_ - num_carry_bits_); |
| 111 | uint64_t word = carry_bits_ | (next_word << num_carry_bits_); |
| 112 | carry_bits_ = next_word >> (64 - num_carry_bits_); |
| 113 | remaining_length_ = std::max<int64_t>(remaining_length_ - 64, 0); |
| 114 | return word; |
| 115 | } else { |
| 116 | remaining_length_ = 0; |
| 117 | return carry_bits_; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | int64_t position() const { return length_ - remaining_length_; } |
| 122 |
nothing calls this directly
no test coverage detected