]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Inserting strings is not slow any longer, remove bypass in deflate_medium().
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Wed, 21 Feb 2024 13:05:29 +0000 (14:05 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 11 Apr 2024 10:43:06 +0000 (12:43 +0200)
deflate_medium.c

index ae7c737ecb117c24a9b3fe91b2889d68d86e3b2f..ca334e4b3558013fd71a6adee5112c643af401f1 100644 (file)
@@ -63,10 +63,8 @@ static void insert_match(deflate_state *s, struct match match) {
         return;
     }
 
-    /* Insert new strings in the hash table only if the match length
-     * is not too large. This saves time but degrades compression.
-     */
-    if (match.match_length <= 16 * s->max_insert_length && s->lookahead >= WANT_MIN_MATCH) {
+    /* Insert new strings in the hash table. */
+    if (s->lookahead >= WANT_MIN_MATCH) {
         match.match_length--; /* string at strstart already in table */
         match.strstart++;