diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2024-02-12 17:09:10 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2024-02-14 18:31:16 +0200 |
commit | 5e04706b91ca90d6befd4da24a588a55e631d4a9 (patch) | |
tree | 4e23dedcf5b2f3b184bc0e564d29446e6b1b1f6f /src/liblzma/lzma | |
parent | liblzma: Optimize literal_subcoder() macro slightly. (diff) | |
download | xz-5e04706b91ca90d6befd4da24a588a55e631d4a9.tar.xz |
liblzma: LZMA decoder: Optimize loop comparison.
But now it needs one more local variable.
Diffstat (limited to 'src/liblzma/lzma')
-rw-r--r-- | src/liblzma/lzma/lzma_decoder.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/liblzma/lzma/lzma_decoder.c b/src/liblzma/lzma/lzma_decoder.c index 66d2818d..f7323061 100644 --- a/src/liblzma/lzma/lzma_decoder.c +++ b/src/liblzma/lzma/lzma_decoder.c @@ -261,7 +261,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr, const size_t dict_start = dict.pos; // Range decoder - rc_to_local(coder->rc, *in_pos); + rc_to_local(coder->rc, *in_pos, LZMA_IN_REQUIRED); // State uint32_t state = coder->state; @@ -340,8 +340,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr, // If there is not enough room for another LZMA symbol // go to Resumable mode. - if (unlikely(rc_in_end - rc_in_ptr < LZMA_IN_REQUIRED - || dict.pos == dict.limit)) + if (unlikely(!rc_is_fast_allowed() || dict.pos == dict.limit)) goto slow; // Decode the first bit from the next LZMA symbol. |