From: Eric Biggers Date: Sun, 7 Sep 2014 01:49:02 +0000 (-0500) Subject: lzx_decompress_block(): One-branch check for aligned offset case X-Git-Tag: v1.7.2~21 X-Git-Url: https://wimlib.net/git/?a=commitdiff_plain;h=86016ddd3e36b4c5f119d0d1387f8fad527a246e;hp=df4b628740bef19eb067459d02a789fbf8d3a479;p=wimlib lzx_decompress_block(): One-branch check for aligned offset case --- diff --git a/src/lzx-decompress.c b/src/lzx-decompress.c index c8ce9b04..58d1f6b1 100644 --- a/src/lzx-decompress.c +++ b/src/lzx-decompress.c @@ -430,6 +430,7 @@ lzx_decompress_block(int block_type, u32 block_size, unsigned position_slot; u32 match_offset; unsigned num_extra_bits; + unsigned ones_if_aligned = 0U - (block_type == LZX_BLOCKTYPE_ALIGNED); while (window_ptr != window_end) { @@ -475,7 +476,9 @@ lzx_decompress_block(int block_type, u32 block_size, /* In aligned offset blocks, the low-order 3 bits of * each offset are encoded using the aligned offset * code. Otherwise, all the extra bits are literal. */ - if (block_type == LZX_BLOCKTYPE_ALIGNED && num_extra_bits >= 3) { + + /*if (block_type == LZX_BLOCKTYPE_ALIGNED && num_extra_bits >= 3) {*/ + if ((num_extra_bits & ones_if_aligned) >= 3) { match_offset += bitstream_read_bits(istream, num_extra_bits - 3) << 3; match_offset += read_huffsym_using_alignedcode(istream, tables); } else {