Skip to content

Commit ba8dc20

Browse files
committed
Small optimization to return in-memory compressed data quicker
1 parent 673c6d3 commit ba8dc20

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
@@ -349,6 +349,8 @@ def _gzip_header_end(data: bytes) -> int:
349349
raise BadGzipFile(f"Not a gzipped file ({repr(data[:2])})")
350350
if method != 8:
351351
raise BadGzipFile("Unknown compression method")
352+
if not flags: # Likely when data compressed in memory
353+
return 10
352354
pos = 10
353355
if flags & FEXTRA:
354356
if len(data) < pos + 2:

0 commit comments

Comments
 (0)