diff options
author | Nathan Moinvaziri <nathan@solidstatenetworks.com> | 2020-05-09 23:41:18 -0400 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-05-30 21:25:18 +0200 |
commit | 7e3d9be44c0aefeda3973bbe85387aebe1a3c8c4 (patch) | |
tree | c958632f6409c4cc663a7ae1b9ceb4160652dd7d /insert_string_tpl.h | |
parent | 9b7a52352caa1ec398bdda53979de6c9ba667eab (diff) |
Change quick_insert_string memory access to be similar to insert_string.
Diffstat (limited to 'insert_string_tpl.h')
-rw-r--r-- | insert_string_tpl.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/insert_string_tpl.h b/insert_string_tpl.h index 9de7d5d..eee0107 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); |