Skip to content

Commit 0326998

Browse files
committed
Simplify header skipper
1 parent 076a2ff commit 0326998

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/isal/igzip.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,16 +276,14 @@ def _gzip_header_end(data: bytes) -> int:
276276
xlen = int.from_bytes(data[pos: pos + 2], "little", signed=False)
277277
pos += 2 + xlen
278278
if flags & FNAME:
279-
fname_end = data.find(b"\x00", pos) + 1
280-
# fname_end will be -1 + 1 when null byte not found.
281-
if not fname_end:
279+
pos = data.find(b"\x00", pos) + 1
280+
# pos will be -1 + 1 when null byte not found.
281+
if not pos:
282282
raise eof_error
283-
pos = fname_end
284283
if flags & FCOMMENT:
285-
fcomment_end = data.find(b"\x00", pos) + 1
286-
if not fcomment_end:
284+
pos = data.find(b"\x00", pos) + 1
285+
if not pos:
287286
raise eof_error
288-
pos = fcomment_end
289287
if flags & FHCRC:
290288
if len(data) < pos + 2:
291289
raise eof_error

0 commit comments

Comments
 (0)