MEDIUM: shctx: Simplify shctx_row_reserve_hot loop
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 16 Nov 2023 16:38:13 +0000 (17:38 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 16 Nov 2023 18:35:10 +0000 (19:35 +0100)
commit610b67fd8b4f51aff8b6ce008d779b06602a5747
tree233c4178e3511df6867850b19325ddfc4e8941c4
parenteccb97f60e4b47b2511177b23dced6aadb7419da
MEDIUM: shctx: Simplify shctx_row_reserve_hot loop

The shctx_row_reserve_hot relied on two loop levels in order to first
look for the first block of a preused row and then iterate on all the
blocks of this row to reserve them for the new row. This was not the
simplest nor the easiest to read way so this logic could be replaced by
a single iteration on the avail list members.
The two use cases of calling this function with or without a preexisting
"first" member were a bit cumbersome as well and were replaced by a more
straightforward approach.
src/shctx.c