Skip to content

Commit

Permalink
python: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzel committed Mar 18, 2021
1 parent 1bcadea commit e4aa7f6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions python/microvmi/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ def read(self, size: int = ...) -> Optional[bytes]:
raise NotImplementedError
data = bytearray(size)
for offset in range(0, size, PAGE_SIZE):
if size - offset < PAGE_SIZE:
read_len = size - offset
else:
read_len = PAGE_SIZE
read_len = min(PAGE_SIZE, size - offset)
pos = self.tell()
chunk, _ = self._m.read_physical(pos, read_len)
end_offset = offset + read_len
Expand Down

0 comments on commit e4aa7f6

Please sign in to comment.