Skip to content

Commit

Permalink
Kernel: Use Vector::unstable_remove() when deallocating a region
Browse files Browse the repository at this point in the history
Process::m_regions is not sorted, so we can use unstable_remove()
to avoid shifting the vector contents. :^)
  • Loading branch information
awesomekling committed Feb 24, 2020
1 parent f59747a commit d0f5b43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ bool Process::deallocate_region(Region& region)
m_region_lookup_cache.region = nullptr;
for (int i = 0; i < m_regions.size(); ++i) {
if (&m_regions[i] == &region) {
m_regions.remove(i);
m_regions.unstable_remove(i);
return true;
}
}
Expand Down

0 comments on commit d0f5b43

Please sign in to comment.