From: Nathan Moinvaziri Date: Tue, 25 Feb 2020 14:20:54 +0000 (-0800) Subject: Remove duplicate calculations in deflate_quick(). X-Git-Tag: 1.9.9-b1~340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=232fa02a93f73e9830d9fff1dd91973567697fe3;p=thirdparty%2Fzlib-ng.git Remove duplicate calculations in deflate_quick(). --- diff --git a/arch/x86/deflate_quick.c b/arch/x86/deflate_quick.c index 9f6d6b6d9..74b904600 100644 --- a/arch/x86/deflate_quick.c +++ b/arch/x86/deflate_quick.c @@ -238,7 +238,7 @@ ZLIB_INTERNAL block_state deflate_quick(deflate_state *s, int flush) { dist = s->strstart - hash_head; if (dist > 0 && (dist-1) < (s->w_size - 1)) { - match_len = compare258(s->window + s->strstart, s->window + s->strstart - dist); + match_len = compare258(s->window + s->strstart, s->window + hash_head); if (match_len >= MIN_MATCH) { if (match_len > s->lookahead) @@ -247,7 +247,7 @@ ZLIB_INTERNAL block_state deflate_quick(deflate_state *s, int flush) { if (match_len > MAX_MATCH) match_len = MAX_MATCH; - static_emit_ptr(s, match_len - MIN_MATCH, s->strstart - hash_head); + static_emit_ptr(s, match_len - MIN_MATCH, dist); s->lookahead -= match_len; s->strstart += match_len; continue;