]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Use bulk_insert_str when adding more than one byte.
authorMika Lindqvist <postmaster@raasu.org>
Fri, 25 Mar 2016 15:56:41 +0000 (17:56 +0200)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Mon, 30 Jan 2017 10:50:58 +0000 (11:50 +0100)
** Partial merge of this commit, based on f8ad48ab17571c730b743c925f0e13ff83cf487f
Excluding changes to fill_window_sse.c, deflate.c and deflate_p.h

deflate.c
deflate_fast.c
deflate_medium.c

index 739c21f25fa8b6f0a726ab1f036acac338a8452b..556ebaf719a6933c863a770088b9823c25da43df 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -68,7 +68,6 @@ const char deflate_copyright[] = " deflate 1.2.8.f Copyright 1995-2013 Jean-loup
 typedef block_state (*compress_func) (deflate_state *s, int flush);
 /* Compression function. Returns the block state after the call. */
 
-void fill_window                 (deflate_state *s);
 static block_state deflate_stored (deflate_state *s, int flush);
 block_state deflate_fast         (deflate_state *s, int flush);
 block_state deflate_quick        (deflate_state *s, int flush);
index edfe53d7f7d5fa3019dd558e9ac5c64423b7bc52..59618a37fdb19ff06bf141432d5237a8678fd457 100644 (file)
@@ -85,9 +85,13 @@ block_state deflate_fast(deflate_state *s, int flush) {
                 s->strstart += s->match_length;
                 s->match_length = 0;
                 s->ins_h = s->window[s->strstart];
-                UPDATE_HASH(s, s->ins_h, s->strstart+2 - (MIN_MATCH));
+#ifndef NOT_TWEAK_COMPILER
+                bulk_insert_str(s, s->strstart + 2 - MIN_MATCH, MIN_MATCH - 2);
+#else
+                insert_string(s, s->strstart + 2 - MIN_MATCH);
 #if MIN_MATCH != 3
-                Call UPDATE_HASH() MIN_MATCH-3 more times
+#warning        Call insert_string() MIN_MATCH-3 more times
+#endif
 #endif
                 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
                  * matter since it will be recomputed at next deflate call.
index 731b8a26850e67b7fc841e40c8980384ada9608f..c5d39aa4457af0be700db71d580fb501e21c9275 100644 (file)
@@ -112,9 +112,13 @@ static void insert_match(deflate_state *s, struct match match) {
         match.match_length = 0;
         s->ins_h = s->window[match.strstart];
         if (match.strstart >= 1)
-            UPDATE_HASH(s, s->ins_h, match.strstart+2-MIN_MATCH);
+#ifndef NOT_TWEAK_COMPILER
+            bulk_insert_str(s, match.strstart + 2 - MIN_MATCH, MIN_MATCH - 2);
+#else
+            insert_string(s, match.strstart + 2 - MIN_MATCH);
 #if MIN_MATCH != 3
-#warning Call UPDATE_HASH() MIN_MATCH-3 more times
+#warning    Call insert_string() MIN_MATCH-3 more times
+#endif
 #endif
     /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
      * matter since it will be recomputed at next deflate call.