]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Change quick_insert_string memory access to be similar to insert_string.
authorNathan Moinvaziri <nathan@solidstatenetworks.com>
Sun, 10 May 2020 03:41:18 +0000 (23:41 -0400)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 30 May 2020 19:25:18 +0000 (21:25 +0200)
insert_string_tpl.h

index 9de7d5d66d9fb7cab610a2ef5722bad644b291e3..eee01070e92f40f2da74e7362428fdea2ad0976e 100644 (file)
  */
 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);