mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-11 13:32:14 -04:00
decompress: no extra condition is needed when calculating subtable length
This commit is contained in:
parent
446e2268b3
commit
6e5ef3ea7f
@ -661,10 +661,14 @@ build_decode_table(u32 decode_table[],
|
|||||||
* there are fewer than 2**n codewords of length
|
* there are fewer than 2**n codewords of length
|
||||||
* 'table_bits + n' remaining, then n will need to be
|
* 'table_bits + n' remaining, then n will need to be
|
||||||
* incremented to bring in longer codewords until the
|
* incremented to bring in longer codewords until the
|
||||||
* subtable can be filled completely. */
|
* subtable can be filled completely. Note that it
|
||||||
|
* always will, eventually, be possible to fill the
|
||||||
|
* subtable, since the only case where we may have an
|
||||||
|
* incomplete code is a single codeword of length 1,
|
||||||
|
* and that never requires any subtables. */
|
||||||
cur_table_bits = codeword_len - table_bits;
|
cur_table_bits = codeword_len - table_bits;
|
||||||
remainder = (s32)1 << cur_table_bits;
|
remainder = (s32)1 << cur_table_bits;
|
||||||
while (table_bits + cur_table_bits < max_codeword_len) {
|
for (;;) {
|
||||||
remainder -= len_counts[table_bits +
|
remainder -= len_counts[table_bits +
|
||||||
cur_table_bits];
|
cur_table_bits];
|
||||||
if (remainder <= 0)
|
if (remainder <= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user