Skip to content

Commit 5fe9995

Browse files
committed
Simplify kMaxCount
1 parent d03c7eb commit 5fe9995

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/src/arrow/util/rle_encoding_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,8 @@ auto RleBitPackedParser::PeekImpl(Handler&& handler) const
670670
const uint32_t count = run_len_type >> 1;
671671
if (is_bit_packed) {
672672
// Bit-packed run
673-
constexpr auto kMaxCount = bit_util::CeilDiv(internal::max_size_for_v<rle_size_t>, 8);
674-
if (ARROW_PREDICT_FALSE(count == 0 || count >= kMaxCount)) {
673+
constexpr auto kMaxCount = internal::max_size_for_v<rle_size_t> / 8;
674+
if (ARROW_PREDICT_FALSE(count == 0 || count > kMaxCount)) {
675675
// Illegal number of encoded values
676676
return {0, ControlFlow::Break};
677677
}

0 commit comments

Comments
 (0)