From 2e175db7336cf332db396735d39ea7311352cb1f Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:43:51 -0500 Subject: [PATCH] Clean logic FindDmemArea guarantees that the first dmem area we check contains search_start. Any dmem areas beyond the first one will be entirely past search_start, so checking against it in the loop is unnecessary. --- src/core/memory.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index a804f2ef8..494ffa70c 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -151,9 +151,7 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, size_t size, dmem_area++; // Update local variables based on the new dmem_area - mapping_start = search_start > dmem_area->second.base - ? Common::AlignUp(search_start, alignment) - : Common::AlignUp(dmem_area->second.base, alignment); + mapping_start = Common::AlignUp(dmem_area->second.base, alignment); mapping_end = mapping_start + size; }