From d9627503a9d3c33824efcb8836b33d5808f53bd6 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Wed, 29 Mar 2023 01:43:57 +0200 Subject: [PATCH] LibCompress: Reduce repeated code in the LZMA decompressor --- Userland/Libraries/LibCompress/Lzma.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Userland/Libraries/LibCompress/Lzma.cpp b/Userland/Libraries/LibCompress/Lzma.cpp index 5deafa2c0a..92a1f21894 100644 --- a/Userland/Libraries/LibCompress/Lzma.cpp +++ b/Userland/Libraries/LibCompress/Lzma.cpp @@ -628,13 +628,7 @@ ErrorOr LzmaDecompressor::read_some(Bytes bytes) // MATCH/LITERAL symbol." update_state_after_short_rep(); - u8 byte; - auto read_bytes = TRY(m_dictionary->read_with_seekback({ &byte, sizeof(byte) }, m_rep0 + 1)); - VERIFY(read_bytes.size() == sizeof(byte)); - - auto written_bytes = m_dictionary->write({ &byte, sizeof(byte) }); - VERIFY(written_bytes == sizeof(byte)); - m_total_decoded_bytes++; + TRY(copy_match_to_buffer(1)); continue; }