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

Method PutZigZagVlqInt

cpp/src/arrow/util/bit_stream_utils_internal.h:402–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400
401template <typename Int>
402inline bool BitWriter::PutZigZagVlqInt(Int v) {
403 static_assert(std::is_integral_v<Int>);
404 static_assert(std::is_signed_v<Int>);
405 using UInt = std::make_unsigned_t<Int>;
406 constexpr auto kBitSize = 8 * sizeof(Int);
407
408 UInt u_v = ::arrow::util::SafeCopy<UInt>(v);
409 u_v = (u_v << 1) ^ static_cast<UInt>(v >> (kBitSize - 1));
410 return PutVlqInt(u_v);
411}
412
413template <typename Int>
414inline bool BitReader::GetZigZagVlqInt(Int* v) {

Callers 4

TestZigZagFunction · 0.80
TestZigZag64Function · 0.80
FlushBlockMethod · 0.80
FlushValuesMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestZigZagFunction · 0.64
TestZigZag64Function · 0.64