From 2c7fbfba2f19f87c7920a18ab6a69fa9675bd56a Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Fri, 5 Dec 2025 17:52:47 -0800 Subject: Compute w_mask rather than storing it in the deflate_state structure Co-authored-by: Brian Pane --- insert_string_tpl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'insert_string_tpl.h') 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; -- cgit 0.0.5-2-1-g0f52