1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

LibCompress/Brotli: Remove CanonicalCode::clear()

This function was used in a single place and don't provide a huge
benefit over simply recreating the object.
This commit is contained in:
Lucas CHOLLET 2023-07-21 13:29:52 -04:00 committed by Andreas Kling
parent 63e72feee1
commit 3fdf5072ec
2 changed files with 2 additions and 8 deletions

View file

@ -446,11 +446,10 @@ ErrorOr<void> BrotliDecompressionStream::read_block_configuration(Block& block)
block.type_previous = 1; block.type_previous = 1;
block.number_of_types = blocks_of_type; block.number_of_types = blocks_of_type;
block.type_code.clear();
block.length_code.clear();
if (blocks_of_type == 1) { if (blocks_of_type == 1) {
block.length = 16 * MiB; block.length = 16 * MiB;
block.type_code = {};
block.length_code = {};
} else { } else {
block.type_code = TRY(CanonicalCode::read_prefix_code(m_input_stream, 2 + blocks_of_type)); block.type_code = TRY(CanonicalCode::read_prefix_code(m_input_stream, 2 + blocks_of_type));
block.length_code = TRY(CanonicalCode::read_prefix_code(m_input_stream, 26)); block.length_code = TRY(CanonicalCode::read_prefix_code(m_input_stream, 26));

View file

@ -27,11 +27,6 @@ public:
static ErrorOr<CanonicalCode> read_complex_prefix_code(LittleEndianInputBitStream&, size_t alphabet_size, size_t hskip); static ErrorOr<CanonicalCode> read_complex_prefix_code(LittleEndianInputBitStream&, size_t alphabet_size, size_t hskip);
ErrorOr<size_t> read_symbol(LittleEndianInputBitStream&) const; ErrorOr<size_t> read_symbol(LittleEndianInputBitStream&) const;
void clear()
{
m_symbol_codes.clear();
m_symbol_values.clear();
}
private: private:
static ErrorOr<size_t> read_complex_prefix_code_length(LittleEndianInputBitStream&); static ErrorOr<size_t> read_complex_prefix_code_length(LittleEndianInputBitStream&);