From dd753715a99e1ec258fc38b4761071e199495ede Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Tue, 18 Aug 2020 17:45:48 -0700 Subject: Move zero check for insert_string count to fill_window since it is the only place where count is ever passed as zero. --- insert_string_tpl.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'insert_string_tpl.h') diff --git a/insert_string_tpl.h b/insert_string_tpl.h index 127a7ca8d1..4900010cac 100644 --- a/insert_string_tpl.h +++ b/insert_string_tpl.h @@ -61,17 +61,11 @@ ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str * (except for the last MIN_MATCH-1 bytes of the input file). */ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) { - Pos idx, ret; - uint8_t *strstart, *strend; - - if (UNLIKELY(count == 0)) { - return s->prev[str & s->w_mask]; - } - - strstart = s->window + str; - strend = strstart + count - 1; /* last position */ + Pos idx, ret = 0; + uint8_t *strstart = s->window + str; + uint8_t *strend = strstart + count - 1; /* last position */ - for (ret = 0, idx = str; strstart <= strend; idx++, strstart++) { + for (idx = str; strstart <= strend; idx++, strstart++) { uint32_t val, hm, h = 0; #ifdef UNALIGNED_OK -- cgit 0.0.5-2-1-g0f52