Skip to content

Commit

Permalink
More changes for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
dma1dma1 committed May 28, 2024
1 parent adf0f9e commit fae4335
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion codalab/lib/beam/MultiReaderFileStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def peek(self, index: int, num_bytes): # type: ignore

with self._lock:
# Calculate how many new bytes need to be read
new_bytes_needed = num_bytes - (max(self._pos) - self._pos[index])
new_pos = self._pos[index] + num_bytes
new_bytes_needed = new_pos - max(self._pos)
if new_bytes_needed > 0:
self._fill_buf_bytes(new_bytes_needed)

Expand Down

0 comments on commit fae4335

Please sign in to comment.