]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Now that the check is out of the loop, it is also safe to remove it
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Wed, 19 Aug 2020 08:50:44 +0000 (10:50 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 21 Aug 2020 07:46:03 +0000 (09:46 +0200)
and unconditionally return head.

insert_string_tpl.h

index b37dae26da095a660281da2df19584380e4567c0..f5d61cee4d1ea6213adf56beb1a1c43542daa7f2 100644 (file)
@@ -61,7 +61,7 @@ ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str
  *    (except for the last MIN_MATCH-1 bytes of the input file).
  */
 ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) {
-    Pos head, idx, ret = 0;
+    Pos head = 0, idx;
     uint8_t *strstart = s->window + str;
     uint8_t *strend = strstart + count - 1; /* last position */
     uint32_t hash_mask = s->hash_mask;
@@ -88,12 +88,6 @@ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint
         }
     }
 
-    if (strstart == strend) {
-        if (head != idx)
-            ret = head;
-        else
-            ret = idx;
-    }
-    return ret;
+    return head;
 }
 #endif