aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lz/lz_encoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-10 17:13:42 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-10 17:13:42 +0200
commitf73c2ab6079ed5675a42b39d584a567befbd4624 (patch)
treea80a9102eaea398af2f65bcd401f1621176a14eb /src/liblzma/lz/lz_encoder.c
parentDefine HAVE_ASM_X86 when x86 assembler optimizations are (diff)
downloadxz-f73c2ab6079ed5675a42b39d584a567befbd4624.tar.xz
Eliminate lzma_lz_encoder.must_move_pos. It's needed
only in one place which isn't performance criticial.
Diffstat (limited to 'src/liblzma/lz/lz_encoder.c')
-rw-r--r--src/liblzma/lz/lz_encoder.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/liblzma/lz/lz_encoder.c b/src/liblzma/lz/lz_encoder.c
index bc38cae2..629f9df2 100644
--- a/src/liblzma/lz/lz_encoder.c
+++ b/src/liblzma/lz/lz_encoder.c
@@ -179,10 +179,8 @@ lzma_lz_encoder_reset(lzma_lz_encoder *lz, lzma_allocator *allocator,
}
}
- // Allocation successful. Store the new size and calculate
- // must_move_pos.
+ // Allocation successful. Store the new size.
lz->size = buffer_size;
- lz->must_move_pos = lz->size - lz->keep_size_after;
// Reset in window variables.
lz->offset = 0;
@@ -373,7 +371,7 @@ fill_window(lzma_coder *coder, lzma_allocator *allocator, const uint8_t *in,
lzma_ret ret;
// Move the sliding window if needed.
- if (coder->lz.read_pos >= coder->lz.must_move_pos)
+ if (coder->lz.read_pos >= coder->lz.size - coder->lz.keep_size_after)
move_window(&coder->lz);
if (coder->next.code == NULL) {