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:
parent
f59747a3d8
commit
d0f5b43c2e
Notes:
sideshowbarker
2024-07-19 09:05:05 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d0f5b43c2eb
1 changed files with 1 additions and 1 deletions
|
@ -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] == ®ion) {
|
||||
m_regions.remove(i);
|
||||
m_regions.unstable_remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue