| 412 | |
| 413 | template <typename Int> |
| 414 | inline bool BitReader::GetZigZagVlqInt(Int* v) { |
| 415 | static_assert(std::is_integral_v<Int>); |
| 416 | static_assert(std::is_signed_v<Int>); |
| 417 | |
| 418 | std::make_unsigned_t<Int> u; |
| 419 | if (!GetVlqInt(&u)) return false; |
| 420 | u = (u >> 1) ^ (~(u & 1) + 1); |
| 421 | *v = ::arrow::util::SafeCopy<Int>(u); |
| 422 | return true; |
| 423 | } |
| 424 | |
| 425 | } // namespace arrow::bit_util |
no outgoing calls