From bf608f125eeb80a79fae20d98413cca1dbfdd486 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Jul 2018 11:51:10 -0400 Subject: [PATCH] video_core/memory_manager: Replace a loop with std::array's fill() function in PageSlot() We already have a function that does what this code was doing, so let's use that instead. --- src/video_core/memory_manager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 98a6ca040..ca923d17d 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -138,9 +138,7 @@ VAddr& MemoryManager::PageSlot(GPUVAddr gpu_addr) { auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK]; if (!block) { block = std::make_unique(); - for (unsigned index = 0; index < PAGE_BLOCK_SIZE; index++) { - (*block)[index] = static_cast(PageStatus::Unmapped); - } + block->fill(static_cast(PageStatus::Unmapped)); } return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK]; }