mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
[BZip2] Remove redundant check for zero code lengths
Such code lengths are now filtered out during Huffman code construction.
This commit is contained in:
@@ -173,9 +173,7 @@ public class BZip2: DecompressionAlgorithm {
|
||||
length -= (bitReader.bit().toInt() * 2 - 1)
|
||||
bitsLeft -= 1
|
||||
}
|
||||
if length > 0 {
|
||||
codeLengths.append(CodeLength(symbol: i, codeLength: length))
|
||||
}
|
||||
codeLengths.append(CodeLength(symbol: i, codeLength: length))
|
||||
}
|
||||
let codes = Code.huffmanCodes(from: codeLengths)
|
||||
let table = DecodingTree(codes, bitReader)
|
||||
|
||||
Reference in New Issue
Block a user