Skip to content

Commit

Permalink
Kernel: Use the InstrusiveRedBlackTree::begin_from(V&) API
Browse files Browse the repository at this point in the history
This let's us skip an O(logn) tree traversal.
  • Loading branch information
IdanHo authored and awesomekling committed Apr 3, 2022
1 parent 1787d94 commit d6e4a25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/Memory/AddressSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ ErrorOr<Vector<Region*>> 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));
Expand Down

0 comments on commit d6e4a25

Please sign in to comment.