]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
deflate_medium: more readability initialize structs match
authorHerman Semenoff <GermanAizek@yandex.ru>
Mon, 9 Feb 2026 14:19:55 +0000 (17:19 +0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 16 Feb 2026 21:44:35 +0000 (22:44 +0100)
deflate_medium.c

index 3849beeb996a5446fad3faf13747a5838329ebf2..668b2d4c398792770d42ba95e8448e1940f06684 100644 (file)
@@ -163,15 +163,12 @@ static void fizzle_matches(deflate_state *s, struct match *current, struct match
 
 Z_INTERNAL block_state deflate_medium(deflate_state *s, int flush) {
     /* Align the first struct to start on a new cacheline, this allows us to fit both structs in one cacheline */
-    ALIGNED_(16) struct match current_match;
-                 struct match next_match;
+    ALIGNED_(16) struct match current_match = {0};
+                 struct match next_match = {0};
 
     /* For levels below 5, don't check the next position for a better match */
     int early_exit = s->level < 5;
 
-    memset(&current_match, 0, sizeof(struct match));
-    memset(&next_match, 0, sizeof(struct match));
-
     for (;;) {
         uint32_t hash_head = 0;    /* head of the hash chain */
         int bflush = 0;       /* set if current block must be flushed */