From 3adc1ac1ebe221427857d8f6fd06cfb823b4bea6 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 28 May 2014 19:05:19 -0500 Subject: [PATCH] lzx-compress.c: Simplify calculation of position footer --- src/lzx-compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lzx-compress.c b/src/lzx-compress.c index e1b65c7c..ba3b10aa 100644 --- a/src/lzx-compress.c +++ b/src/lzx-compress.c @@ -962,8 +962,8 @@ lzx_tally_match(unsigned match_len, unsigned match_offset, /* The match offset shall be encoded as a position slot (itself encoded * as part of the main symbol) and a position footer. */ position_slot = lzx_get_position_slot(match_offset, queue); - position_footer = (match_offset + LZX_OFFSET_OFFSET) & - ((1U << lzx_get_num_extra_bits(position_slot)) - 1); + position_footer = (match_offset + LZX_OFFSET_OFFSET) - + lzx_position_base[position_slot]; /* The match length shall be encoded as a length header (itself encoded * as part of the main symbol) and an optional length footer. */ -- 2.43.0