Skip to content

Commit d0d6577

Browse files
committed
Cleanup
1 parent 0763831 commit d0d6577

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pyiceberg/table/puffin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Short for: Puffin Fratercula arctica, version 1
2929
MAGIC_BYTES = b"PFA1"
3030
EMPTY_BITMAP = FrozenBitMap()
31-
MAX_JAVA_SIGNED = int(math.pow(2, 31))
31+
MAX_JAVA_SIGNED = int(math.pow(2, 31)) - 1
3232
PROPERTY_REFERENCED_DATA_FILE = "referenced-data-file"
3333

3434

@@ -38,7 +38,7 @@ def _deserialize_bitmap(pl: bytes) -> List[BitMap]:
3838

3939
bitmaps = []
4040
last_key = -1
41-
while number_of_bitmaps > 0:
41+
for _ in range(number_of_bitmaps):
4242
key = int.from_bytes(pl[0:4], byteorder="little")
4343
if key < 0:
4444
raise ValueError(f"Invalid unsigned key: {key}")
@@ -59,8 +59,6 @@ def _deserialize_bitmap(pl: bytes) -> List[BitMap]:
5959

6060
last_key = key
6161

62-
number_of_bitmaps -= 1
63-
6462
return bitmaps
6563

6664

0 commit comments

Comments
 (0)