From c43fefde831e52099c5be6de19e158e792439cf2 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 8 Sep 2020 13:51:19 -0400 Subject: [PATCH] maple_tree: Use get_slots for extend_null Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 18e38eae0085..578772401d33 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2868,9 +2868,11 @@ static inline unsigned char mas_extend_null(struct ma_state *l_mas, unsigned char l_slot = mas_offset(l_mas); unsigned char r_slot = mas_offset(r_mas); unsigned char cp_r_slot = r_slot; - void *content = mas_get_slot(l_mas, l_slot); unsigned long range_max = mas_safe_pivot(r_mas, r_slot); unsigned long range_min = l_mas->min; + void **slots = ma_get_slots(mte_to_node(l_mas->node), + mte_node_type(l_mas->node)); + void *content = slots[l_slot]; if (l_slot) range_min = mas_safe_pivot(l_mas, l_slot - 1) + 1; @@ -2879,7 +2881,7 @@ static inline unsigned char mas_extend_null(struct ma_state *l_mas, l_mas->index = range_min; if ((l_mas->index == range_min) && - l_slot && !mas_get_slot(l_mas, l_slot - 1)) { + l_slot && !slots[l_slot - 1]) { if (l_slot > 1) l_mas->index = mas_safe_pivot(l_mas, l_slot - 2) + 1; else @@ -2887,14 +2889,16 @@ static inline unsigned char mas_extend_null(struct ma_state *l_mas, mas_set_offset(l_mas, l_slot - 1); } - if (!mas_get_slot(r_mas, r_slot)) { + slots = ma_get_slots(mte_to_node(r_mas->node), + mte_node_type(r_mas->node)); + if (!slots[r_slot]) { if (r_mas->last < range_max) r_mas->last = range_max; cp_r_slot++; } if (r_mas->last == range_max && - r_mas->last < r_mas->max && !mas_get_slot(r_mas, r_slot + 1)) { + r_mas->last < r_mas->max && !slots[r_slot + 1]) { r_mas->last = mas_safe_pivot(r_mas, r_slot + 1); cp_r_slot++; } -- 2.50.1