diff options
| author | Nathan Moinvaziri <nathan@solidstatenetworks.com> | 2020-03-26 10:05:00 -0400 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-04-30 10:01:46 +0200 |
| commit | 51e695092d18cae456af802bec106192f73d9bf6 (patch) | |
| tree | f70d8311c3c75eeb072cd02ca2093f58ee09e596 | |
| parent | 78e94a1e9f22e7e4f04525b2ab9482981d912414 (diff) | |
| download | Project-Tick-51e695092d18cae456af802bec106192f73d9bf6.tar.gz Project-Tick-51e695092d18cae456af802bec106192f73d9bf6.zip | |
Replaced insert_string with quick_insert_string if length is 1.
| -rw-r--r-- | arch/x86/fill_window_sse.c | 4 | ||||
| -rw-r--r-- | deflate.c | 4 | ||||
| -rw-r--r-- | deflate_fast.c | 6 | ||||
| -rw-r--r-- | deflate_medium.c | 10 | ||||
| -rw-r--r-- | deflate_slow.c | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/arch/x86/fill_window_sse.c b/arch/x86/fill_window_sse.c index 3cac1cb935..be35f9f5eb 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) @@ -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 af1401169d..5659926127 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 43fb0bfcfc..31f8372327 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 43931f227f..fb217ccd74 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; |
