]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Make mtree_range_walk() more efficient
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 22 Feb 2022 16:57:30 +0000 (11:57 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 8 Mar 2022 18:19:14 +0000 (13:19 -0500)
Only check offset < end

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 66fea07cb8d39523d8571f2e45659b3ecc9589ed..41d1bcbdaa18d38b937210e95e9a8a18cf73ad74 100644 (file)
@@ -2815,14 +2815,9 @@ static inline void *mtree_range_walk(struct ma_state *mas)
                } while((offset < end) && (pivots[offset] < mas->index));
 
                prev_min = min;
+               min = pivots[offset - 1] + 1;
                prev_max = max;
-               if (offset < mt_pivots[type] && pivots[offset])
-                       max = pivots[offset];
-
-               if (offset)
-                       min = pivots[offset - 1] + 1;
-
-               if (likely(offset > end) && pivots[offset])
+               if (likely(offset < end && pivots[offset]))
                        max = pivots[offset];
 
 next: