Skip to content
Snippets Groups Projects
Commit cb5362cebec5 authored by Lasse Collin's avatar Lasse Collin
Browse files

liblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA.

This gives a tiny encoder speed improvement. This could have been done
in 2014 after the commit 544aaa3d13554e8640f9caf7db717a96360ec0f6 but
it was forgotten.
parent 7242ffe5b541
Branches
No related tags found
No related merge requests found
...@@ -636,9 +636,10 @@ ...@@ -636,9 +636,10 @@
uint32_t len_test_2 = len_test + 1; uint32_t len_test_2 = len_test + 1;
const uint32_t limit = my_min(buf_avail_full, const uint32_t limit = my_min(buf_avail_full,
len_test_2 + nice_len); len_test_2 + nice_len);
for (; len_test_2 < limit // NOTE: len_test_2 may be greater than limit so the call to
&& buf[len_test_2] == buf_back[len_test_2]; // lzma_memcmplen() must be done conditionally.
++len_test_2) ; if (len_test_2 < limit)
len_test_2 = lzma_memcmplen(buf, buf_back, len_test_2, limit);
len_test_2 -= len_test + 1; len_test_2 -= len_test + 1;
...@@ -732,9 +733,12 @@ ...@@ -732,9 +733,12 @@
const uint32_t limit = my_min(buf_avail_full, const uint32_t limit = my_min(buf_avail_full,
len_test_2 + nice_len); len_test_2 + nice_len);
for (; len_test_2 < limit && // NOTE: len_test_2 may be greater than limit
buf[len_test_2] == buf_back[len_test_2]; // so the call to lzma_memcmplen() must be
++len_test_2) ; // done conditionally.
if (len_test_2 < limit)
len_test_2 = lzma_memcmplen(buf, buf_back,
len_test_2, limit);
len_test_2 -= len_test + 1; len_test_2 -= len_test + 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment