]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Replaced insert_string with quick_insert_string if length is 1.
authorNathan Moinvaziri <nathan@solidstatenetworks.com>
Thu, 26 Mar 2020 14:05:00 +0000 (10:05 -0400)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 30 Apr 2020 08:01:46 +0000 (10:01 +0200)
arch/x86/fill_window_sse.c
deflate.c
deflate_fast.c
deflate_medium.c
deflate_slow.c

index 3cac1cb9359d1df0c3989e17352f71044424cb3f..be35f9f5ebb70e30f8d2e986dfc7d51d92218484 100644 (file)
@@ -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)
index edc9d712352701ce8cfd461f5ecdfdd8debfc691..00e2b5624480c362a8c64146716b7978448d4b56 100644 (file)
--- 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)
index af1401169d2d2a921791f4b0ba4489b0b23883d5..56599261278694fe49755f1d09e7ee489d4fa048 100644 (file)
@@ -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
index 43fb0bfcfc84754bfe8e7c0dd9c90f0bfae67593..31f837232786c6b564c0ca8a2e90f6df4d692155 100644 (file)
@@ -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;
index 43931f227f133695fa2fb114b03d9f0779c5e54c..fb217ccd74e44c3b0363994dd4023c4d2371b7ac 100644 (file)
@@ -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;