]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: cache: use ASSUME_NONNULL() instead of DISGUISE()
authorWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2024 09:53:17 +0000 (10:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2024 16:42:11 +0000 (17:42 +0100)
DISGUISE() was used to avoid a NULL warning. Using ASSUME_NONNULL()
instead makes it clearer and made the function slightly shorter.

src/cache.c

index d2cf401d6285aceaf500775e49fde5ce21a5f2a0..d4d74d3a4b4f3e1793848589877c935c8b5e5478 100644 (file)
@@ -820,8 +820,7 @@ cache_store_http_payload(struct stream *s, struct filter *filter, struct http_ms
                goto no_cache;
        }
 
-       /* disguise below to shut a warning on */
-       DISGUISE((struct cache_entry *)st->first_block->data)->body_size += data_len;
+       ASSUME_NONNULL((struct cache_entry *)st->first_block->data)->body_size += data_len;
        ret = shctx_row_data_append(shctx, st->first_block,
                                    (unsigned char *)b_head(&trash), b_data(&trash));
        if (ret < 0)