[BZip2] Remove redundant check for zero code lengths

Such code lengths are now filtered out during Huffman code construction.
This commit is contained in:
Timofey Solomko
2026-03-01 20:35:22 +08:00
parent 8310b985f2
commit 93e2eef38d
+1 -3
View File
@@ -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)