From: Nathan Moinvaziri Date: Thu, 26 Mar 2020 14:05:00 +0000 (-0400) Subject: Replaced insert_string with quick_insert_string if length is 1. X-Git-Tag: 1.9.9-b1~321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e695092d18cae456af802bec106192f73d9bf6;p=thirdparty%2Fzlib-ng.git Replaced insert_string with quick_insert_string if length is 1. --- diff --git a/arch/x86/fill_window_sse.c b/arch/x86/fill_window_sse.c index 3cac1cb93..be35f9f5e 100644 --- a/arch/x86/fill_window_sse.c +++ b/arch/x86/fill_window_sse.c @@ -91,11 +91,11 @@ ZLIB_INTERNAL void fill_window_sse(deflate_state *s) { unsigned int str = s->strstart - s->insert; s->ins_h = s->window[str]; if (str >= 1) - functable.insert_string(s, str + 2 - MIN_MATCH, 1); + functable.quick_insert_string(s, str + 2 - MIN_MATCH); #if MIN_MATCH != 3 #error Call insert_string() MIN_MATCH-3 more times while (s->insert) { - functable.insert_string(s, str, 1); + functable.quick_insert_string(s, str); str++; s->insert--; if (s->lookahead + s->insert < MIN_MATCH) diff --git a/deflate.c b/deflate.c index edc9d7123..00e2b5624 100644 --- a/deflate.c +++ b/deflate.c @@ -1293,11 +1293,11 @@ void ZLIB_INTERNAL fill_window_c(deflate_state *s) { unsigned int str = s->strstart - s->insert; s->ins_h = s->window[str]; if (str >= 1) - functable.insert_string(s, str + 2 - MIN_MATCH, 1); + functable.quick_insert_string(s, str + 2 - MIN_MATCH); #if MIN_MATCH != 3 #error Call insert_string() MIN_MATCH-3 more times while (s->insert) { - functable.insert_string(s, str, 1); + functable.quick_insert_string(s, str); str++; s->insert--; if (s->lookahead + s->insert < MIN_MATCH) diff --git a/deflate_fast.c b/deflate_fast.c index af1401169..565992612 100644 --- a/deflate_fast.c +++ b/deflate_fast.c @@ -41,7 +41,7 @@ ZLIB_INTERNAL block_state deflate_fast(deflate_state *s, int flush) { */ hash_head = NIL; if (s->lookahead >= MIN_MATCH) { - hash_head = functable.insert_string(s, s->strstart, 1); + hash_head = functable.quick_insert_string(s, s->strstart); } /* Find the longest match, discarding those <= prev_length. @@ -70,7 +70,7 @@ ZLIB_INTERNAL block_state deflate_fast(deflate_state *s, int flush) { s->strstart++; #ifdef NOT_TWEAK_COMPILER do { - functable.insert_string(s, s->strstart, 1); + functable.quick_insert_string(s, s->strstart); s->strstart++; /* strstart never exceeds WSIZE-MAX_MATCH, so there are * always MIN_MATCH bytes ahead. @@ -90,7 +90,7 @@ ZLIB_INTERNAL block_state deflate_fast(deflate_state *s, int flush) { #ifndef NOT_TWEAK_COMPILER functable.insert_string(s, s->strstart + 2 - MIN_MATCH, MIN_MATCH - 2); #else - functable.insert_string(s, s->strstart + 2 - MIN_MATCH, 1); + functable.quick_insert_string(s, s->strstart + 2 - MIN_MATCH); #if MIN_MATCH != 3 #warning Call insert_string() MIN_MATCH-3 more times #endif diff --git a/deflate_medium.c b/deflate_medium.c index 43fb0bfcf..31f837232 100644 --- a/deflate_medium.c +++ b/deflate_medium.c @@ -56,7 +56,7 @@ static void insert_match(deflate_state *s, struct match match) { if (match.match_length) { if (match.strstart >= match.orgstart) { - functable.insert_string(s, match.strstart, 1); + functable.quick_insert_string(s, match.strstart); } } } @@ -87,7 +87,7 @@ static void insert_match(deflate_state *s, struct match match) { #ifdef NOT_TWEAK_COMPILER do { if (LIKELY(match.strstart >= match.orgstart)) { - functable.insert_string(s, match.strstart, 1); + functable.quick_insert_string(s, match.strstart); } match.strstart++; /* strstart never exceeds WSIZE-MAX_MATCH, so there are @@ -115,7 +115,7 @@ static void insert_match(deflate_state *s, struct match match) { #ifndef NOT_TWEAK_COMPILER functable.insert_string(s, match.strstart + 2 - MIN_MATCH, MIN_MATCH - 2); #else - functable.insert_string(s, match.strstart + 2 - MIN_MATCH, 1); + functable.quick_insert_string(s, match.strstart + 2 - MIN_MATCH); #if MIN_MATCH != 3 #warning Call insert_string() MIN_MATCH-3 more times #endif @@ -229,7 +229,7 @@ ZLIB_INTERNAL block_state deflate_medium(deflate_state *s, int flush) { } else { hash_head = 0; if (s->lookahead >= MIN_MATCH) { - hash_head = functable.insert_string(s, s->strstart, 1); + hash_head = functable.quick_insert_string(s, s->strstart); } /* set up the initial match to be a 1 byte literal */ @@ -263,7 +263,7 @@ ZLIB_INTERNAL block_state deflate_medium(deflate_state *s, int flush) { /* now, look ahead one */ if (s->lookahead > MIN_LOOKAHEAD && (uint32_t)(current_match.strstart + current_match.match_length) < (s->window_size - MIN_LOOKAHEAD)) { s->strstart = current_match.strstart + current_match.match_length; - hash_head = functable.insert_string(s, s->strstart, 1); + hash_head = functable.quick_insert_string(s, s->strstart); /* set up the initial match to be a 1 byte literal */ next_match.match_start = 0; diff --git a/deflate_slow.c b/deflate_slow.c index 43931f227..fb217ccd7 100644 --- a/deflate_slow.c +++ b/deflate_slow.c @@ -49,7 +49,7 @@ ZLIB_INTERNAL block_state deflate_slow(deflate_state *s, int flush) { */ hash_head = NIL; if (s->lookahead >= MIN_MATCH) { - hash_head = functable.insert_string(s, s->strstart, 1); + hash_head = functable.quick_insert_string(s, s->strstart); } /* Find the longest match, discarding those <= prev_length. @@ -99,7 +99,7 @@ ZLIB_INTERNAL block_state deflate_slow(deflate_state *s, int flush) { s->prev_length -= 2; do { if (++s->strstart <= max_insert) { - functable.insert_string(s, s->strstart, 1); + functable.quick_insert_string(s, s->strstart); } } while (--s->prev_length != 0); s->match_available = 0;