diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-03-29 01:43:57 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-30 14:39:31 +0200 |
commit | d9627503a9d3c33824efcb8836b33d5808f53bd6 (patch) | |
tree | 0ee476f349f326d30ab31c275fbbde544a77763e /Userland/Libraries/LibCompress | |
parent | afa158bf99abb800875c642400da03ebc99dd722 (diff) | |
download | serenity-d9627503a9d3c33824efcb8836b33d5808f53bd6.zip |
LibCompress: Reduce repeated code in the LZMA decompressor
Diffstat (limited to 'Userland/Libraries/LibCompress')
-rw-r--r-- | Userland/Libraries/LibCompress/Lzma.cpp | 8 |
1 files changed, 1 insertions, 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<Bytes> 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; } |