mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
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:
parent
6dfd541ca8
commit
1f93622779
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user