mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-08-03 09:46:04 -04:00
hc_matchfinder: make skip_positions() return void
This commit is contained in:
parent
c16ba46008
commit
320c306db3
@ -2182,13 +2182,13 @@ deflate_compress_greedy(struct libdeflate_compressor * restrict c,
|
||||
/* Match found. */
|
||||
deflate_choose_match(c, length, offset, &seq);
|
||||
observe_match(&c->split_stats, length);
|
||||
in_next = hc_matchfinder_skip_positions(
|
||||
&c->p.g.hc_mf,
|
||||
hc_matchfinder_skip_positions(&c->p.g.hc_mf,
|
||||
&in_cur_base,
|
||||
in_next + 1,
|
||||
in_end,
|
||||
length - 1,
|
||||
next_hashes);
|
||||
in_next += length;
|
||||
} else {
|
||||
/* No match found. */
|
||||
deflate_choose_literal(c, *in_next, seq);
|
||||
@ -2295,13 +2295,13 @@ deflate_compress_lazy_generic(struct libdeflate_compressor * restrict c,
|
||||
if (cur_len >= nice_len) {
|
||||
deflate_choose_match(c, cur_len, cur_offset,
|
||||
&seq);
|
||||
in_next = hc_matchfinder_skip_positions(
|
||||
&c->p.g.hc_mf,
|
||||
hc_matchfinder_skip_positions(&c->p.g.hc_mf,
|
||||
&in_cur_base,
|
||||
in_next,
|
||||
in_end,
|
||||
cur_len - 1,
|
||||
next_hashes);
|
||||
in_next += cur_len - 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2384,14 +2384,16 @@ deflate_compress_lazy_generic(struct libdeflate_compressor * restrict c,
|
||||
*/
|
||||
deflate_choose_match(c, cur_len, cur_offset,
|
||||
&seq);
|
||||
if (cur_len > 3)
|
||||
in_next = hc_matchfinder_skip_positions(
|
||||
if (cur_len > 3) {
|
||||
hc_matchfinder_skip_positions(
|
||||
&c->p.g.hc_mf,
|
||||
&in_cur_base,
|
||||
in_next,
|
||||
in_end,
|
||||
cur_len - 3,
|
||||
next_hashes);
|
||||
in_next += cur_len - 3;
|
||||
}
|
||||
} else { /* !lazy2 */
|
||||
/*
|
||||
* No better match at the next position. Output
|
||||
@ -2399,13 +2401,13 @@ deflate_compress_lazy_generic(struct libdeflate_compressor * restrict c,
|
||||
*/
|
||||
deflate_choose_match(c, cur_len, cur_offset,
|
||||
&seq);
|
||||
in_next = hc_matchfinder_skip_positions(
|
||||
&c->p.g.hc_mf,
|
||||
hc_matchfinder_skip_positions(&c->p.g.hc_mf,
|
||||
&in_cur_base,
|
||||
in_next,
|
||||
in_end,
|
||||
cur_len - 2,
|
||||
next_hashes);
|
||||
in_next += cur_len - 2;
|
||||
}
|
||||
/* Check if it's time to output another block. */
|
||||
} while (in_next < in_max_block_end &&
|
||||
|
@ -357,10 +357,8 @@ out:
|
||||
* The precomputed hash codes for the sequence beginning at @in_next.
|
||||
* These will be used and then updated with the precomputed hashcodes for
|
||||
* the sequence beginning at @in_next + @count.
|
||||
*
|
||||
* Returns @in_next + @count.
|
||||
*/
|
||||
static forceinline const u8 *
|
||||
static forceinline void
|
||||
hc_matchfinder_skip_positions(struct hc_matchfinder * const restrict mf,
|
||||
const u8 ** const restrict in_base_p,
|
||||
const u8 *in_next,
|
||||
@ -374,7 +372,7 @@ hc_matchfinder_skip_positions(struct hc_matchfinder * const restrict mf,
|
||||
u32 remaining = count;
|
||||
|
||||
if (unlikely(count + 5 > in_end - in_next))
|
||||
return &in_next[count];
|
||||
return;
|
||||
|
||||
cur_pos = in_next - *in_base_p;
|
||||
hash3 = next_hashes[0];
|
||||
@ -399,8 +397,6 @@ hc_matchfinder_skip_positions(struct hc_matchfinder * const restrict mf,
|
||||
prefetchw(&mf->hash4_tab[hash4]);
|
||||
next_hashes[0] = hash3;
|
||||
next_hashes[1] = hash4;
|
||||
|
||||
return in_next;
|
||||
}
|
||||
|
||||
#endif /* LIB_HC_MATCHFINDER_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user