]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Store hash_mask in local variable for insert_string loop.
authorNathan Moinvaziri <nathan@nathanm.com>
Wed, 19 Aug 2020 00:46:55 +0000 (17:46 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 20 Aug 2020 19:49:17 +0000 (21:49 +0200)
insert_string_tpl.h

index 4900010cac68cc9542c8012dcd813ef67ce1b15f..00aad32d87d068cb18fe03c79ffada1b814f9ab0 100644 (file)
@@ -64,6 +64,7 @@ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint
     Pos idx, ret = 0;
     uint8_t *strstart = s->window + str;
     uint8_t *strend = strstart + count - 1; /* last position */
+    uint32_t hash_mask = s->hash_mask;
 
     for (idx = str; strstart <= strend; idx++, strstart++) {
         uint32_t val, hm, h = 0;
@@ -78,7 +79,7 @@ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint
 #endif
 
         UPDATE_HASH(s, h, val);
-        hm = h & s->hash_mask;
+        hm = h & hash_mask;
 
         Pos head = s->head[hm];
         if (head != idx) {