From 93e2eef38d9c47a435cd08880e687266f2fee7bd Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Sun, 1 Mar 2026 19:55:04 +0800 Subject: [PATCH] [BZip2] Remove redundant check for zero code lengths Such code lengths are now filtered out during Huffman code construction. --- Sources/BZip2/BZip2.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/BZip2/BZip2.swift b/Sources/BZip2/BZip2.swift index 215ebda4..a8b7e556 100644 --- a/Sources/BZip2/BZip2.swift +++ b/Sources/BZip2/BZip2.swift @@ -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)