Kernel: Use Vector::unstable_remove() when deallocating a region

Process::m_regions is not sorted, so we can use unstable_remove()
to avoid shifting the vector contents. :^)
This commit is contained in:
Andreas Kling 2020-02-23 18:00:30 +01:00
parent f59747a3d8
commit d0f5b43c2e
Notes: sideshowbarker 2024-07-19 09:05:05 +09:00

View file

@ -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;
}
}