1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:47:35 +00:00

LibCompress: Remove a few no-op continue statements in Deflate

Alternatively, we could remove the else after the continue, but
all branches here should be equally prominent, so this seems a bit
nicer.

No behavior change.
This commit is contained in:
Nico Weber 2023-04-04 09:15:49 -04:00 committed by Andreas Kling
parent 1097f3066e
commit 72d6a30e08

View file

@ -437,17 +437,14 @@ ErrorOr<void> DeflateDecompressor::decode_codes(CanonicalCode& literal_code, Opt
if (symbol < deflate_special_code_length_copy) { if (symbol < deflate_special_code_length_copy) {
code_lengths.append(static_cast<u8>(symbol)); code_lengths.append(static_cast<u8>(symbol));
continue;
} else if (symbol == deflate_special_code_length_zeros) { } else if (symbol == deflate_special_code_length_zeros) {
auto nrepeat = 3 + TRY(m_input_stream->read_bits(3)); auto nrepeat = 3 + TRY(m_input_stream->read_bits(3));
for (size_t j = 0; j < nrepeat; ++j) for (size_t j = 0; j < nrepeat; ++j)
code_lengths.append(0); code_lengths.append(0);
continue;
} else if (symbol == deflate_special_code_length_long_zeros) { } else if (symbol == deflate_special_code_length_long_zeros) {
auto nrepeat = 11 + TRY(m_input_stream->read_bits(7)); auto nrepeat = 11 + TRY(m_input_stream->read_bits(7));
for (size_t j = 0; j < nrepeat; ++j) for (size_t j = 0; j < nrepeat; ++j)
code_lengths.append(0); code_lengths.append(0);
continue;
} else { } else {
VERIFY(symbol == deflate_special_code_length_copy); VERIFY(symbol == deflate_special_code_length_copy);