summaryrefslogtreecommitdiff
path: root/insert_string_tpl.h
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2020-08-18 17:46:55 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-08-20 21:49:17 +0200
commit38e5e4b20c204fb16a1026c754c5b320f27395b4 (patch)
tree37c95efb90cf5595c6fa9d5d523d468713549862 /insert_string_tpl.h
parentdd753715a99e1ec258fc38b4761071e199495ede (diff)
Store hash_mask in local variable for insert_string loop.
Diffstat (limited to 'insert_string_tpl.h')
-rw-r--r--insert_string_tpl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/insert_string_tpl.h b/insert_string_tpl.h
index 4900010..00aad32 100644
--- a/insert_string_tpl.h
+++ b/insert_string_tpl.h
@@ -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) {