From 3fdf5072ec715ffa6a58789baf565cd8113e9768 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Fri, 21 Jul 2023 13:29:52 -0400 Subject: [PATCH] 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. --- Userland/Libraries/LibCompress/Brotli.cpp | 5 ++--- Userland/Libraries/LibCompress/Brotli.h | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Userland/Libraries/LibCompress/Brotli.cpp b/Userland/Libraries/LibCompress/Brotli.cpp index efa2c8b1a6..3527adad01 100644 --- a/Userland/Libraries/LibCompress/Brotli.cpp +++ b/Userland/Libraries/LibCompress/Brotli.cpp @@ -446,11 +446,10 @@ ErrorOr BrotliDecompressionStream::read_block_configuration(Block& block) block.type_previous = 1; block.number_of_types = blocks_of_type; - block.type_code.clear(); - block.length_code.clear(); - if (blocks_of_type == 1) { block.length = 16 * MiB; + block.type_code = {}; + block.length_code = {}; } else { 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)); diff --git a/Userland/Libraries/LibCompress/Brotli.h b/Userland/Libraries/LibCompress/Brotli.h index a9290bd42c..054257aaab 100644 --- a/Userland/Libraries/LibCompress/Brotli.h +++ b/Userland/Libraries/LibCompress/Brotli.h @@ -27,11 +27,6 @@ public: static ErrorOr read_complex_prefix_code(LittleEndianInputBitStream&, size_t alphabet_size, size_t hskip); ErrorOr read_symbol(LittleEndianInputBitStream&) const; - void clear() - { - m_symbol_codes.clear(); - m_symbol_values.clear(); - } private: static ErrorOr read_complex_prefix_code_length(LittleEndianInputBitStream&);