[PATCH 2/2] maple_tree: refactor mas_wr_store_type()

Wei Yang richard.weiyang at gmail.com
Fri Oct 11 20:31:41 PDT 2024


On Fri, Oct 11, 2024 at 05:44:51PM -0400, Sidhartha Kumar wrote:
>In mas_wr_store_type(), we check if new_end < mt_slots[wr_mas->type]. If
>this check fails, we know that ,after this, new_end is >= mt_min_slots.
>Checking this again when we detect a wr_node_store later in the function
>is reduntant. Because this check is part of an OR statement, the statement
>will always evaluate to true, therefore we can just get rid of it.
>
>We also refactor mas_wr_store_type() to return the store type rather
>than set it directly as it greatly cleans up the function.
>
>Suggested-by: Liam Howlett <liam.howlett at oracle.com>
>Suggested-by: Wei Yang <richard.weiyang at gmail.com>
>Signed-off-by: Sidhartha <sidhartha.kumar at oracle.com>

Reviewed-by: Wei Yang <richard.weiyang at gmail.com>

-- 
Wei Yang
Help you, Help me



More information about the maple-tree mailing list