CLEANUP: stats: use ASSUME_NONNULL() to indicate that the first block exists

In stats_scope_ptr(), the validity of blk() was assumed using
ALREADY_CHECKED(blk), but we can now use the cleaner ASSUME_NONNULL().
In addition this simplifies the BUG_ON() check that follows.
This commit is contained in:
Willy Tarreau 2024-12-17 14:31:08 +01:00
parent 6dfd541ca8
commit 1f93622779

View file

@ -293,9 +293,8 @@ const char *stats_scope_ptr(struct appctx *appctx)
struct htx_blk *blk;
struct ist uri;
blk = htx_get_head_blk(htx);
BUG_ON(!blk || htx_get_blk_type(blk) != HTX_BLK_REQ_SL);
ALREADY_CHECKED(blk);
blk = ASSUME_NONNULL(htx_get_head_blk(htx));
BUG_ON(htx_get_blk_type(blk) != HTX_BLK_REQ_SL);
uri = htx_sl_req_uri(htx_get_blk_ptr(htx, blk));
return uri.ptr + ctx->scope_str;
}