Skip to content

Commit

Permalink
suceed faster for known header magics
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Dec 4, 2024
1 parent 79d2f19 commit be64fe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion refinery/units/compression/decompress.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(
)
self.engines: List[Unit] = [
engine.assemble() for engine in [
zstd, szdd, brotli, zl, lzma, aplib, qlz, lzf, lzw, jcalg, bz2, blz, lzjb, lz4, lzo, lznt1, nrv2e, nrv2d, nrv2b]
zstd, szdd, bz2, zl, lzf, lzma, lzw, jcalg, lzo, aplib, qlz, brotli, blz, lzjb, lz4, lznt1, nrv2e, nrv2d, nrv2b]
]
for engine in self.engines:
engine.log_detach()
Expand Down
5 changes: 5 additions & 0 deletions refinery/units/compression/lzf.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,8 @@ def process(self, data):
raise RefineryPartialResult(msg, out.getvalue())

return out.getvalue()

@classmethod
def handles(self, data: bytearray):
if data[:2] == LZFHeader.MAGIC:
return True

0 comments on commit be64fe9

Please sign in to comment.