From 1ac2d7c17e8ff714ecfafea4f82579e4970db689 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 12 Oct 2021 09:31:27 -0400 Subject: [PATCH] maple_tree: Reduce mas_ascend() call to dead_node Since the node is known and the parent is known, use them directly. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1592bb2212ab3..9275c26c34901 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1018,23 +1018,24 @@ static int mas_ascend(struct ma_state *mas) unsigned char offset; bool set_max = false, set_min = false; + a_node = mas_mn(mas); if (ma_is_root(a_node)) { mas->offset = 0; return 0; } - p_node = mte_parent(mas->node); a_type = mas_parent_enum(mas, mas->node); offset = mte_parent_slot(mas->node); - a_enode = mt_mk_node(p_node, a_type); - if (unlikely(mas_mn(mas) == p_node)) + p_node = mte_parent(mas->node); + if (unlikely(a_node == p_node)) return 1; /* Check to make sure all parent information is still accurate */ if (p_node != mte_parent(mas->node)) return 1; + a_enode = mt_mk_node(p_node, a_type); mas->node = a_enode; mas->offset = offset; -- 2.50.1