Skip to content

Commit 49e3112

Browse files
committed
Inline _add_read_data call
1 parent a2075d5 commit 49e3112

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/isal/igzip.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,6 @@ def __init__(self, fp):
249249
self._new_member = True
250250
self._last_mtime = None
251251

252-
def _add_read_data(self, data):
253-
# Use faster isal crc32 calculation and update the stream size in place
254-
# compared to CPython gzip
255-
self._crc = isal_zlib.crc32(data, self._crc)
256-
self._stream_size += len(data)
257-
258252
def read(self, size=-1):
259253
if size < 0:
260254
return self.readall()
@@ -302,7 +296,8 @@ def read(self, size=-1):
302296
raise EOFError("Compressed file ended before the "
303297
"end-of-stream marker was reached")
304298

305-
self._add_read_data(uncompress)
299+
self._crc = isal_zlib.crc32(uncompress, self._crc)
300+
self._stream_size += len(uncompress)
306301
self._pos += len(uncompress)
307302
return uncompress
308303

0 commit comments

Comments
 (0)