mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
Kernel: Avoid some un-necessary copies coming from range based for loops
- The irq_controller was getting add_ref/released needlessly during enumeration. - Used ranges were also getting needlessly copied.
This commit is contained in:
parent
a5f879ea8c
commit
7482cb6531
Notes:
sideshowbarker
2024-07-18 22:15:36 +09:00
Author: https://github.com/bgianfo
Commit: 7482cb6531
Pull-request: https://github.com/SerenityOS/serenity/pull/5359
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/bugaevc
2 changed files with 3 additions and 3 deletions
|
@ -195,7 +195,7 @@ void MemoryManager::parse_memory_map()
|
|||
auto* mmap_begin = reinterpret_cast<multiboot_memory_map_t*>(low_physical_to_virtual(multiboot_info_ptr->mmap_addr));
|
||||
auto* mmap_end = reinterpret_cast<multiboot_memory_map_t*>(low_physical_to_virtual(multiboot_info_ptr->mmap_addr) + multiboot_info_ptr->mmap_length);
|
||||
|
||||
for (auto used_range : m_used_memory_ranges) {
|
||||
for (auto& used_range : m_used_memory_ranges) {
|
||||
klog() << "MM: " << used_range;
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ void MemoryManager::parse_memory_map()
|
|||
|
||||
// Skip used memory ranges.
|
||||
bool should_skip = false;
|
||||
for (auto used_range : m_used_memory_ranges) {
|
||||
for (auto& used_range : m_used_memory_ranges) {
|
||||
if (addr.get() >= used_range.start.get() && addr.get() <= used_range.end.get()) {
|
||||
should_skip = true;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue