aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_encoder_optimum_fast.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-10-26 10:36:41 +0300
committerLasse Collin <lasse.collin@tukaani.org>2010-10-26 10:36:41 +0300
commit974ebe63497bdf0d262e06474f0dd5a70b1dd000 (patch)
treeb64367c4f90a4856439502ef3265a676e8019704 /src/liblzma/lzma/lzma_encoder_optimum_fast.c
parentBump version 5.1.0alpha. (diff)
downloadxz-974ebe63497bdf0d262e06474f0dd5a70b1dd000.tar.xz
liblzma: Rename a few variables and constants.
This has no semantic changes. I find the new names slightly more logical and they match the names that are already used in XZ Embedded. The name fastpos wasn't changed (not worth the hassle).
Diffstat (limited to 'src/liblzma/lzma/lzma_encoder_optimum_fast.c')
-rw-r--r--src/liblzma/lzma/lzma_encoder_optimum_fast.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/liblzma/lzma/lzma_encoder_optimum_fast.c b/src/liblzma/lzma/lzma_encoder_optimum_fast.c
index f835f693..92bbdf79 100644
--- a/src/liblzma/lzma/lzma_encoder_optimum_fast.c
+++ b/src/liblzma/lzma/lzma_encoder_optimum_fast.c
@@ -46,7 +46,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
uint32_t rep_len = 0;
uint32_t rep_index = 0;
- for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
+ for (uint32_t i = 0; i < REPS; ++i) {
// Pointer to the beginning of the match candidate
const uint8_t *const buf_back = buf - coder->reps[i] - 1;
@@ -79,8 +79,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
// We didn't find a long enough repeated match. Encode it as a normal
// match if the match length is at least nice_len.
if (len_main >= nice_len) {
- *back_res = coder->matches[matches_count - 1].dist
- + REP_DISTANCES;
+ *back_res = coder->matches[matches_count - 1].dist + REPS;
*len_res = len_main;
mf_skip(mf, len_main - 1);
return;
@@ -155,7 +154,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
const uint32_t limit = len_main - 1;
- for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
+ for (uint32_t i = 0; i < REPS; ++i) {
const uint8_t *const buf_back = buf - coder->reps[i] - 1;
if (not_equal_16(buf, buf_back))
@@ -172,7 +171,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
}
}
- *back_res = back_main + REP_DISTANCES;
+ *back_res = back_main + REPS;
*len_res = len_main;
mf_skip(mf, len_main - 2);
return;