From a2ddf054f29c6669c01bc5b5028c875449a84194 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 29 May 2024 18:24:41 -0400 Subject: [PATCH] LibGfx/WebPWriter: Remove two obsolete comments In an early version of the huffman writing code, we always used 8 bits here, and the comments still reflected that. Since we're now always writing only as many bits as we need (in practice, still almost always 8), the comments are misleading. --- Userland/Libraries/LibGfx/ImageFormats/WebPWriterLossless.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPWriterLossless.cpp b/Userland/Libraries/LibGfx/ImageFormats/WebPWriterLossless.cpp index 3ad7a74cc7a..76459c2b567 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/WebPWriterLossless.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/WebPWriterLossless.cpp @@ -189,8 +189,8 @@ static ErrorOr write_normal_code_lengths(LittleEndianOutputBitStr unsigned needed_length_nbits = ceil(log2(encoded_lengths_count - 2)); VERIFY(needed_length_nbits <= 16); needed_length_nbits = ceil_div(needed_length_nbits, 2) * 2; - TRY(bit_stream.write_bits((needed_length_nbits - 2) / 2, 3u)); // length_nbits = 2 + 2 * 3 == 8 - TRY(bit_stream.write_bits(encoded_lengths_count - 2, needed_length_nbits)); // max_symbol = 2 + 254 + TRY(bit_stream.write_bits((needed_length_nbits - 2) / 2, 3u)); + TRY(bit_stream.write_bits(encoded_lengths_count - 2, needed_length_nbits)); } // The rest is identical to write_dynamic_huffman() again. (Code 16 has different semantics, but that doesn't matter here.)