We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d73585f commit 72c0a86Copy full SHA for 72c0a86
mapbuffer/mapbuffer.py
@@ -237,14 +237,14 @@ def size(self, label:int) -> int:
237
pos = self.find_index_position(label)
238
index = self.index()
239
N = index.shape[0]
240
- offset = index[i,1]
+ offset = index[pos,1]
241
242
crc_compensation = 0
243
if self.format_version > 0:
244
crc_compensation = 4
245
246
- if i < N - 1:
247
- next_offset = index[i+1,1]
+ if pos < N - 1:
+ next_offset = index[pos+1,1]
248
return next_offset - offset - crc_compensation
249
else:
250
return len(self.buffer) - offset - crc_compensation
0 commit comments