From 7e3d9be44c0aefeda3973bbe85387aebe1a3c8c4 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Sat, 9 May 2020 23:41:18 -0400 Subject: Change quick_insert_string memory access to be similar to insert_string. --- insert_string_tpl.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'insert_string_tpl.h') diff --git a/insert_string_tpl.h b/insert_string_tpl.h index 9de7d5d66d..eee01070e9 100644 --- a/insert_string_tpl.h +++ b/insert_string_tpl.h @@ -29,15 +29,16 @@ */ ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const Pos str) { Pos head; + uint8_t *strstart = s->window + str; uint32_t val, hm, h = 0; #ifdef UNALIGNED_OK - val = *(uint32_t *)(s->window + str); + val = *(uint32_t *)(strstart); #else - val = ((uint32_t)s->window[str]); - val |= ((uint32_t)s->window[str+1] << 8); - val |= ((uint32_t)s->window[str+2] << 16); - val |= ((uint32_t)s->window[str+3] << 24); + val = ((uint32_t)(strstart[0])); + val |= ((uint32_t)(strstart[1]) << 8); + val |= ((uint32_t)(strstart[2]) << 16); + val |= ((uint32_t)(strstart[3]) << 24); #endif UPDATE_HASH(s, h, val); -- cgit 0.0.5-2-1-g0f52