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

LibCompress: Reduce indentation in CompressedBlock::try_read_more()

...by removing `else` after `return`.

No behavior change.
This commit is contained in:
Nico Weber 2023-04-01 07:43:46 -04:00 committed by Andreas Kling
parent bc6e61adec
commit bc70d7bb77

View file

@ -185,10 +185,13 @@ ErrorOr<bool> DeflateDecompressor::CompressedBlock::try_read_more()
u8 byte_symbol = symbol; u8 byte_symbol = symbol;
m_decompressor.m_output_buffer.write({ &byte_symbol, sizeof(byte_symbol) }); m_decompressor.m_output_buffer.write({ &byte_symbol, sizeof(byte_symbol) });
return true; return true;
} else if (symbol == 256) { }
if (symbol == 256) {
m_eof = true; m_eof = true;
return false; return false;
} else { }
if (!m_distance_codes.has_value()) if (!m_distance_codes.has_value())
return Error::from_string_literal("Distance codes have not been initialized"); return Error::from_string_literal("Distance codes have not been initialized");
@ -203,7 +206,6 @@ ErrorOr<bool> DeflateDecompressor::CompressedBlock::try_read_more()
for (size_t idx = 0; idx < length; ++idx) { for (size_t idx = 0; idx < length; ++idx) {
u8 byte = 0; u8 byte = 0;
TRY(m_decompressor.m_output_buffer.read_with_seekback({ &byte, sizeof(byte) }, distance)); TRY(m_decompressor.m_output_buffer.read_with_seekback({ &byte, sizeof(byte) }, distance));
m_decompressor.m_output_buffer.write({ &byte, sizeof(byte) }); m_decompressor.m_output_buffer.write({ &byte, sizeof(byte) });
} }
} else { } else {
@ -212,7 +214,6 @@ ErrorOr<bool> DeflateDecompressor::CompressedBlock::try_read_more()
return true; return true;
} }
}
DeflateDecompressor::UncompressedBlock::UncompressedBlock(DeflateDecompressor& decompressor, size_t length) DeflateDecompressor::UncompressedBlock::UncompressedBlock(DeflateDecompressor& decompressor, size_t length)
: m_decompressor(decompressor) : m_decompressor(decompressor)