Skip to content

Commit 5bfcddd

Browse files
committed
Size of bool may not be one
1 parent f31cd6f commit 5bfcddd

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

cpp/src/arrow/util/bpacking_scalar_codegen.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ class ScalarUnpackGenerator:
7777

7878
@property
7979
def out_bit_width(self) -> int:
80-
if self.out_type == "bool":
81-
return 8
82-
elif self.out_type.startswith("uint"):
80+
if self.out_type.startswith("uint"):
8381
return int(self.out_type.removeprefix("uint").removesuffix("_t"))
8482
raise NotImplementedError(f"Unsupported type {self.out_type}")
8583

@@ -218,7 +216,7 @@ def print_uint32_fallback_struct(self):
218216
def print_structs(self):
219217
# The algorithm works for uint16_t (for simd width <=256) but is slower
220218
# than using uint32_t + static_cast loop
221-
if self.out_bit_width <= 16:
219+
if self.out_type == "bool" or self.out_bit_width <= 16:
222220
self.print_uint32_fallback_struct()
223221
return
224222
for bit in range(1, self.out_bit_width):

cpp/src/arrow/util/bpacking_scalar_generated_internal.h

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)