Skip to content

Commit 3611bdb

Browse files
committed
Improve decompress method
1 parent 0be0416 commit 3611bdb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
from typing import Dict
77

8-
from isal import isal_zlib
8+
from isal import igzip, isal_zlib # noqa: F401 used in timeit strings
99

1010
DATA_DIR = Path(__file__).parent / "tests" / "data"
1111
COMPRESSED_FILE = DATA_DIR / "test.fastq.gz"

src/isal/igzip.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def decompress(data):
166166
"""Decompress a gzip compressed string in one shot.
167167
Return the decompressed string.
168168
"""
169-
with IGzipFile(fileobj=io.BytesIO(data), mode="rb") as f:
170-
return f.read()
169+
return isal_zlib.decompress(data, wbits=16 + isal_zlib.MAX_WBITS)
171170

172171

173172
def main():

0 commit comments

Comments
 (0)