Skip to content

Commit 0a52c0c

Browse files
committed
Don't use unpack16
1 parent eda2210 commit 0a52c0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/src/arrow/util/bit_stream_utils_internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ inline int BitReader::GetBatch(int num_bits, T* v, int batch_size) {
323323
}
324324
}
325325

326-
if constexpr (sizeof(T) >= 2) {
326+
// unpack for uint16_t not as fast as unpack for uint32_t + memcpy.
327+
if constexpr (sizeof(T) >= sizeof(32)) {
327328
int num_unpacked = internal::unpack(buffer + byte_offset,
328329
reinterpret_cast<std::make_unsigned_t<T>*>(v + i),
329330
batch_size - i, num_bits);

0 commit comments

Comments
 (0)