Skip to content

Commit 7fd99ed

Browse files
committed
Comment style
1 parent 90eaaad commit 7fd99ed

1 file changed

Lines changed: 29 additions & 29 deletions

File tree

cpp/src/arrow/util/rle_bitmap_test.cc

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ namespace arrow::util {
3030

3131
namespace {
3232

33-
// Expand a list of bytes into the bit-packed (LSB-first) sequence of booleans
34-
// they encode, keeping only the first `count` bits.
33+
/// Expand a list of bytes into the bit-packed (LSB-first) sequence of booleans
34+
/// they encode, keeping only the first `count` bits.
3535
std::vector<bool> BitsFromBytes(const std::vector<uint8_t>& bytes, rle_size_t count) {
3636
std::vector<bool> bits(count);
3737
for (rle_size_t i = 0; i < count; ++i) {
@@ -40,18 +40,18 @@ std::vector<bool> BitsFromBytes(const std::vector<uint8_t>& bytes, rle_size_t co
4040
return bits;
4141
}
4242

43-
// Skip the first `skip` values with Advance(), then decode the rest of the run
44-
// into a contiguous output bitmap, in successive calls of at most `chunk` values
45-
// each, and compare the result against `expected`.
46-
//
47-
// This drives both decoder types through their byte-aligned and bit-unaligned
48-
// code paths depending on `chunk`: as soon as `chunk` is not a multiple of 8,
49-
// later calls land on a non-zero output bit offset.
50-
//
51-
// A non-zero `skip` additionally desynchronizes the decoder's read offset from
52-
// the (byte-aligned) output offset, which exercises the bit-unaligned
53-
// (GetBatchMisaligned) path of BitPackedRunToBitMapDecoder. With `skip == 0` the
54-
// read and output offsets stay in lockstep and only the aligned path is used.
43+
/// Skip the first `skip` values with Advance(), then decode the rest of the run
44+
/// into a contiguous output bitmap, in successive calls of at most `chunk` values
45+
/// each, and compare the result against `expected`.
46+
///
47+
/// This drives both decoder types through their byte-aligned and bit-unaligned
48+
/// code paths depending on `chunk`: as soon as `chunk` is not a multiple of 8,
49+
/// later calls land on a non-zero output bit offset.
50+
///
51+
/// A non-zero `skip` additionally desynchronizes the decoder's read offset from
52+
/// the (byte-aligned) output offset, which exercises the bit-unaligned
53+
/// (GetBatchMisaligned) path of BitPackedRunToBitMapDecoder. With `skip == 0` the
54+
/// read and output offsets stay in lockstep and only the aligned path is used.
5555
template <typename Decoder>
5656
void CheckChunkedDecode(const typename Decoder::RunType& run,
5757
const std::vector<bool>& expected, rle_size_t chunk,
@@ -87,8 +87,8 @@ void CheckChunkedDecode(const typename Decoder::RunType& run,
8787
}
8888
}
8989

90-
// The full battery of checks shared by both decoder types. `expected` is the
91-
// full sequence of booleans the run is supposed to decode to.
90+
/// The full battery of checks shared by both decoder types. `expected` is the
91+
/// full sequence of booleans the run is supposed to decode to.
9292
template <typename Decoder>
9393
void CheckBitMapDecoder(const typename Decoder::RunType& run,
9494
const std::vector<bool>& expected) {
@@ -294,7 +294,7 @@ INSTANTIATE_TEST_SUITE_P(
294294

295295
namespace {
296296

297-
// Append the LEB128 (unsigned, little-endian base-128) encoding of `value`.
297+
/// Append the LEB128 (unsigned, little-endian base-128) encoding of `value`.
298298
void AppendLeb128(std::vector<uint8_t>& out, uint32_t value) {
299299
uint8_t buf[bit_util::kMaxLEB128ByteLenFor<uint32_t>];
300300
const auto n_vals =
@@ -303,17 +303,17 @@ void AppendLeb128(std::vector<uint8_t>& out, uint32_t value) {
303303
out.insert(out.end(), buf, buf + n_vals);
304304
}
305305

306-
// Append an RLE run of `count` copies of `value` (1-bit values) to the encoded
307-
// `bytes` stream and to the `expected` decoded sequence.
306+
/// Append an RLE run of `count` copies of `value` (1-bit values) to the encoded
307+
/// `bytes` stream and to the `expected` decoded sequence.
308308
void AppendRleRun(std::vector<uint8_t>& bytes, std::vector<bool>& expected, bool value,
309309
rle_size_t count) {
310310
AppendLeb128(bytes, static_cast<uint32_t>(count) << 1); // low bit 0 => RLE
311311
bytes.push_back(value ? 1 : 0);
312312
expected.insert(expected.end(), count, value);
313313
}
314314

315-
// Append a bit-packed run holding `packed.size()` groups of 8 (1-bit) values,
316-
// LSB first, to the encoded `bytes` stream and to the `expected` sequence.
315+
/// Append a bit-packed run holding `packed.size()` groups of 8 (1-bit) values,
316+
/// LSB first, to the encoded `bytes` stream and to the `expected` sequence.
317317
void AppendBitPackedRun(std::vector<uint8_t>& bytes, std::vector<bool>& expected,
318318
const std::vector<uint8_t>& packed) {
319319
const auto groups = static_cast<rle_size_t>(packed.size());
@@ -324,13 +324,13 @@ void AppendBitPackedRun(std::vector<uint8_t>& bytes, std::vector<bool>& expected
324324
}
325325
}
326326

327-
// Decode the whole `bytes` stream into a bitmap starting at bit offset
328-
// `out_offset`, in successive GetBatch calls of at most `chunk` values, and
329-
// compare against `expected`.
330-
//
331-
// Decoding in small, byte-unaligned chunks and (with a non-zero `out_offset`)
332-
// at a non-aligned output position exercises how the decoder threads its output
333-
// bit offset across runs that do not end on a byte boundary.
327+
/// Decode the whole `bytes` stream into a bitmap starting at bit offset
328+
/// `out_offset`, in successive GetBatch calls of at most `chunk` values, and
329+
/// compare against `expected`.
330+
///
331+
/// Decoding in small, byte-unaligned chunks and (with a non-zero `out_offset`)
332+
/// at a non-aligned output position exercises how the decoder threads its output
333+
/// bit offset across runs that do not end on a byte boundary.
334334
void CheckRleBitPackedDecode(const std::vector<uint8_t>& bytes,
335335
const std::vector<bool>& expected, rle_size_t chunk,
336336
rle_size_t out_offset = 0) {
@@ -375,7 +375,7 @@ void CheckRleBitPackedDecode(const std::vector<uint8_t>& bytes,
375375
}
376376
}
377377

378-
// Run the decode check over a battery of chunk sizes and output offsets.
378+
/// Run the decode check over a battery of chunk sizes and output offsets.
379379
void CheckRleBitPackedToBitMap(const std::vector<uint8_t>& bytes,
380380
const std::vector<bool>& expected) {
381381
const auto n = static_cast<rle_size_t>(expected.size());

0 commit comments

Comments
 (0)