Co-authored-by: Nathan Moinvaziri <nathan@nathanm.com>
/* Initialize the hash value now that we have some input: */
if (s->lookahead + s->insert >= STD_MIN_MATCH) {
unsigned int str = s->strstart - s->insert;
- if (s->max_chain_length > 1024) {
+ if (UNLIKELY(s->max_chain_length > 1024)) {
s->ins_h = s->update_hash(s, s->window[str], s->window[str+1]);
} else if (str >= 1) {
s->quick_insert_string(s, str + 2 - STD_MIN_MATCH);
#endif
#ifdef LONGEST_MATCH_SLOW
/* Look for a better string offset */
- if (len > STD_MIN_MATCH && match_start + len < strstart && rolling_hash) {
+ if (UNLIKELY(len > STD_MIN_MATCH && match_start + len < strstart && rolling_hash)) {
Pos pos, next_pos;
uint32_t i, hash;
unsigned char *scan_endstr;