From d6e4a25e0c671437924703603e4b3f4a85887098 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Mon, 4 Apr 2022 00:21:10 +0300 Subject: Kernel: Use the InstrusiveRedBlackTree::begin_from(V&) API This let's us skip an O(logn) tree traversal. --- Kernel/Memory/AddressSpace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kernel') diff --git a/Kernel/Memory/AddressSpace.cpp b/Kernel/Memory/AddressSpace.cpp index c27afa85c5..a91bd45f96 100644 --- a/Kernel/Memory/AddressSpace.cpp +++ b/Kernel/Memory/AddressSpace.cpp @@ -271,7 +271,7 @@ ErrorOr> AddressSpace::find_regions_intersecting(VirtualRange co auto* found_region = m_region_tree.regions().find_largest_not_above(range.base().get()); if (!found_region) return regions; - for (auto iter = m_region_tree.regions().begin_from((*found_region).vaddr().get()); !iter.is_end(); ++iter) { + for (auto iter = m_region_tree.regions().begin_from(*found_region); !iter.is_end(); ++iter) { auto const& iter_range = (*iter).range(); if (iter_range.base() < range.end() && iter_range.end() > range.base()) { TRY(regions.try_append(&*iter)); -- cgit v1.2.3