michalc / stream-inflate

Uncompress Deflate and Deflate64 streams in pure Python (albeit compiled with Cython)
MIT License
9 stars 2 forks source link

perf: avoid lengths and tuples in huffman decoding #55

Closed michalc closed 1 week ago

michalc commented 1 week ago

By starting the code from a "fake" 1 rather than 0, we no longer need to use the lengths to disambiguate codes, saving both using lengths and tuples.