aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2014-07-25 22:29:49 +0300
committerLasse Collin <lasse.collin@tukaani.org>2014-07-25 22:29:49 +0300
commit6bf5308e34e23dede5b301b1b9b4f131dacd9218 (patch)
treee730fe9bbc91a31cf6b1ec086b5c41f907708721
parentUpdate THANKS. (diff)
downloadxz-6bf5308e34e23dede5b301b1b9b4f131dacd9218.tar.xz
liblzma: Use lzma_memcmplen() in fast mode of LZMA.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lzma/lzma_encoder_optimum_fast.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liblzma/lzma/lzma_encoder_optimum_fast.c b/src/liblzma/lzma/lzma_encoder_optimum_fast.c
index 92bbdf79..7ecb4cc6 100644
--- a/src/liblzma/lzma/lzma_encoder_optimum_fast.c
+++ b/src/liblzma/lzma/lzma_encoder_optimum_fast.c
@@ -10,6 +10,7 @@
///////////////////////////////////////////////////////////////////////////////
#include "lzma_encoder_private.h"
+#include "memcmplen.h"
#define change_pair(small_dist, big_dist) \
@@ -57,9 +58,8 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
// The first two bytes matched.
// Calculate the length of the match.
- uint32_t len;
- for (len = 2; len < buf_avail
- && buf[len] == buf_back[len]; ++len) ;
+ const uint32_t len = lzma_memcmplen(
+ buf, buf_back, 2, buf_avail);
// If we have found a repeated match that is at least
// nice_len long, return it immediately.