summaryrefslogtreecommitdiff
path: root/insert_string_tpl.h
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2025-12-05 17:52:47 -0800
committerHans Kristian Rosbach <hk-github@circlestorm.org>2025-12-09 15:23:33 +0100
commit2c7fbfba2f19f87c7920a18ab6a69fa9675bd56a (patch)
tree208def1cedb0a44915a5f38a9df8f21f2518ea85 /insert_string_tpl.h
parent5c10a6006d78b111a22069ad75ee701959268a97 (diff)
downloadProject-Tick-2c7fbfba2f19f87c7920a18ab6a69fa9675bd56a.tar.gz
Project-Tick-2c7fbfba2f19f87c7920a18ab6a69fa9675bd56a.zip
Compute w_mask rather than storing it in the deflate_state structure
Co-authored-by: Brian Pane <brianp@brianp.net>
Diffstat (limited to 'insert_string_tpl.h')
-rw-r--r--insert_string_tpl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/insert_string_tpl.h b/insert_string_tpl.h
index 04a9b0a6b6..e507fb5917 100644
--- a/insert_string_tpl.h
+++ b/insert_string_tpl.h
@@ -56,7 +56,7 @@ Z_FORCEINLINE static Pos QUICK_INSERT_VALUE(deflate_state *const s, uint32_t str
head = s->head[hm];
if (LIKELY(head != str)) {
- s->prev[str & s->w_mask] = head;
+ s->prev[str & W_MASK(s)] = head;
s->head[hm] = (Pos)str;
}
return head;
@@ -80,7 +80,7 @@ Z_FORCEINLINE static Pos QUICK_INSERT_STRING(deflate_state *const s, uint32_t st
head = s->head[hm];
if (LIKELY(head != str)) {
- s->prev[str & s->w_mask] = head;
+ s->prev[str & W_MASK(s)] = head;
s->head[hm] = (Pos)str;
}
return head;
@@ -101,7 +101,7 @@ Z_FORCEINLINE static void INSERT_STRING(deflate_state *const s, uint32_t str, ui
/* Local pointers to avoid indirection */
Pos *headp = s->head;
Pos *prevp = s->prev;
- const unsigned int w_mask = s->w_mask;
+ const unsigned int w_mask = W_MASK(s);
for (Pos idx = (Pos)str; strstart < strend; idx++, strstart++) {
uint32_t val, hm;