Skip to content

Commit 8c0591e

Browse files
committed
Small performance tweak
1 parent d6f00a5 commit 8c0591e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/isal/igzip.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ def _read_gzip_header(fp):
270270
(method, flag, last_mtime) = struct.unpack("<BBIxx", common_fields)
271271
if method != 8:
272272
raise BadGzipFile('Unknown compression method')
273+
if not flag: # Likely when data compressed in memory
274+
return last_mtime
273275
header = magic + common_fields
274276
if flag & FEXTRA:
275277
# Read & discard the extra field, if present

0 commit comments

Comments
 (0)