]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Use insert_string instead of UPDATE_HASH to avoid double hashing.
authorMika Lindqvist <postmaster@raasu.org>
Tue, 14 Feb 2017 07:51:32 +0000 (09:51 +0200)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 16 Feb 2017 10:20:03 +0000 (11:20 +0100)
deflate.c

index ab3565089ec295cd565439bf4797cfd0b7965f1c..72da7e84e4bede5eaa7098f1434fbe4522db3a28 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -1253,14 +1253,12 @@ void fill_window_c(deflate_state *s) {
             unsigned int str = s->strstart - s->insert;
             s->ins_h = s->window[str];
             if (str >= 1)
-                UPDATE_HASH(s, s->ins_h, str + 1 - (MIN_MATCH-1));
+                insert_string(s, str + 2 - MIN_MATCH, 1);
 #if MIN_MATCH != 3
-            Call UPDATE_HASH() MIN_MATCH-3 more times
+#warning    Call insert_string() MIN_MATCH-3 more times
 #endif
             while (s->insert) {
-                UPDATE_HASH(s, s->ins_h, str);
-                s->prev[str & s->w_mask] = s->head[s->ins_h];
-                s->head[s->ins_h] = (Pos)str;
+                insert_string(s, str, 1);
                 str++;
                 s->insert--;
                 if (s->lookahead + s->insert < MIN_MATCH)