We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cbd8389 commit 7bd1e82Copy full SHA for 7bd1e82
1 file changed
flatdata-py/flatdata/lib/data_access.py
@@ -22,9 +22,7 @@ def read_value(data, offset_bits, num_bits, is_signed):
22
remainder = data[offset_bytes + total_bytes]
23
result |= remainder << (total_bytes * 8 - offset_extra_bits)
24
25
- if num_bits < 64:
26
- result = result & ((1 << num_bits) - 1)
27
- elif offset_extra_bits > 0:
+ if num_bits < 64 or offset_extra_bits > 0:
28
result = result & ((1 << num_bits) - 1)
29
30
if not is_signed:
0 commit comments