]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Remove support for STD_MIN_MATCH != 3.
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Mon, 10 May 2021 16:29:40 +0000 (18:29 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 13 Jun 2021 18:55:01 +0000 (20:55 +0200)
It has always been broken and untested anyways.

deflate.c
deflate_fast.c
deflate_medium.c

index 73cd58a448404e2843b8d4af69205cb0a8e7cf03..87ab646292fa8ae650828e0cf7622c556af38931 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -1228,15 +1228,6 @@ void Z_INTERNAL fill_window(deflate_state *s) {
             unsigned int str = s->strstart - s->insert;
             if (str >= 1)
                 functable.quick_insert_string(s, str + 2 - STD_MIN_MATCH);
-#if STD_MIN_MATCH != 3
-            while (s->insert) {
-                functable.quick_insert_string(s, str);
-                str++;
-                s->insert--;
-                if (s->lookahead + s->insert < STD_MIN_MATCH)
-                    break;
-            }
-#else
             unsigned int count;
             if (UNLIKELY(s->lookahead == 1)) {
                 count = s->insert - 1;
@@ -1247,7 +1238,6 @@ void Z_INTERNAL fill_window(deflate_state *s) {
                 functable.insert_string(s, str, count);
                 s->insert -= count;
             }
-#endif
         }
         /* If the whole input has less than STD_MIN_MATCH bytes, ins_h is garbage,
          * but this is not important since only literal bytes will be emitted.
index 074e9676be98e57e99b7515f55b40057ee139511..4142a7aa4c40a5bd93ab26c3a5637516dae4abd8 100644 (file)
@@ -76,11 +76,8 @@ Z_INTERNAL block_state deflate_fast(deflate_state *s, int flush) {
                 s->strstart += match_len;
             } else {
                 s->strstart += match_len;
-#if STD_MIN_MATCH != 3
-                functable.insert_string(s, s->strstart + 2 - STD_MIN_MATCH, STD_MIN_MATCH - 2);
-#else
                 functable.quick_insert_string(s, s->strstart + 2 - STD_MIN_MATCH);
-#endif
+
                 /* If lookahead < STD_MIN_MATCH, ins_h is garbage, but it does not
                  * matter since it will be recomputed at next deflate call.
                  */
index 71eb48350e250dac731380ffcfdcce5b61e4556f..c8d3e7701ff09cae864db4de85b13a42c91e1b13 100644 (file)
@@ -85,12 +85,10 @@ static void insert_match(deflate_state *s, struct match match) {
     } else {
         match.strstart += match.match_length;
         match.match_length = 0;
+
         if (match.strstart >= (STD_MIN_MATCH - 2))
-#if STD_MIN_MATCH != 3
-            functable.insert_string(s, match.strstart + 2 - STD_MIN_MATCH, STD_MIN_MATCH - 2);
-#else
             functable.quick_insert_string(s, match.strstart + 2 - STD_MIN_MATCH);
-#endif
+
         /* If lookahead < WANT_MIN_MATCH, ins_h is garbage, but it does not
          * matter since it will be recomputed at next deflate call.
          */