aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2014-08-04 19:25:58 +0300
committerLasse Collin <lasse.collin@tukaani.org>2014-08-04 19:25:58 +0300
commit71e1437ab585b46f7a25f5a131557d3d1c0cbaa2 (patch)
treed6f863cfcd12fb09cc98712b6849bd913018814e /src/liblzma
parentUpdate THANKS. (diff)
downloadxz-71e1437ab585b46f7a25f5a131557d3d1c0cbaa2.tar.xz
liblzma: Use lzma_memcmplen() in the BT3 match finder.
I had missed this when writing the commit 5db75054e900fa06ef5ade5f2c21dffdd5d16141. Thanks to Jun I Jin.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lz/lz_encoder_mf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/liblzma/lz/lz_encoder_mf.c b/src/liblzma/lz/lz_encoder_mf.c
index 6dc39f4a..78520779 100644
--- a/src/liblzma/lz/lz_encoder_mf.c
+++ b/src/liblzma/lz/lz_encoder_mf.c
@@ -632,9 +632,8 @@ lzma_mf_bt3_find(lzma_mf *mf, lzma_match *matches)
uint32_t len_best = 2;
if (delta2 < mf->cyclic_size && *(cur - delta2) == *cur) {
- for ( ; len_best != len_limit; ++len_best)
- if (*(cur + len_best - delta2) != cur[len_best])
- break;
+ len_best = lzma_memcmplen(
+ cur, cur - delta2, len_best, len_limit);
matches[0].len = len_best;
matches[0].dist = delta2 - 1;