| 274 | } |
| 275 | |
| 276 | void Reset(const RunType& run, rle_size_t value_bit_width) noexcept { |
| 277 | remaining_count_ = run.values_count(); |
| 278 | if constexpr (std::is_same_v<value_type, bool>) { |
| 279 | // ARROW-18031: just check the LSB of the next byte and move on. |
| 280 | // If we memcpy + FromLittleEndian, we have potential undefined behavior |
| 281 | // if the bool value isn't 0 or 1. |
| 282 | value_ = *run.raw_data_ptr() & 1; |
| 283 | } else { |
| 284 | value_ = static_cast<value_type>( |
| 285 | ::arrow::bit_util::FromLittleEndian(run.value_little_endian())); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | /// Return the number of values that can be advanced. |
| 290 | rle_size_t remaining() const { return remaining_count_; } |
no test coverage detected