From b74c500aa9e5e7949ca46f42e0dc62e02136e259 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 14 Apr 2025 01:53:06 -0400 Subject: [SharedCache] Misc cleanup - Make `SharedCache::m_entries` a simple std::vector we never lookup based off the entry ID - Remove some old comments - Rename some old variables so that they are accurate - Fix compiler warnings - Remove some unneeded copying --- view/sharedcache/core/SharedCacheView.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'view/sharedcache/core/SharedCacheView.cpp') diff --git a/view/sharedcache/core/SharedCacheView.cpp b/view/sharedcache/core/SharedCacheView.cpp index 049140c5..5d836ee4 100644 --- a/view/sharedcache/core/SharedCacheView.cpp +++ b/view/sharedcache/core/SharedCacheView.cpp @@ -912,7 +912,7 @@ bool SharedCacheView::InitController() // Write all the slide info pointers to the virtual memory. // This should be done before any other work begins, as the backing data will be altered by this process. auto startTime = std::chrono::high_resolution_clock::now(); - for (const auto& [_, entry] : sharedCache.GetEntries()) + for (const auto& entry : sharedCache.GetEntries()) sharedCache.ProcessEntrySlideInfo(entry); auto endTime = std::chrono::high_resolution_clock::now(); std::chrono::duration elapsed = endTime - startTime; @@ -923,7 +923,7 @@ bool SharedCacheView::InitController() // Load up all images into the cache before adding extra regions. // Currently, it is expected that a primary entry contain all relevant images, so we only check that one. auto startTime = std::chrono::high_resolution_clock::now(); - for (const auto& [_, entry] : sharedCache.GetEntries()) + for (const auto& entry : sharedCache.GetEntries()) if (entry.GetType() == CacheEntryType::Primary) sharedCache.ProcessEntryImages(entry); auto endTime = std::chrono::high_resolution_clock::now(); @@ -936,10 +936,9 @@ bool SharedCacheView::InitController() } { - // TODO: Run this up on a separate thread maybe and have callback notifications? // Load up all the regions into the cache. auto startTime = std::chrono::high_resolution_clock::now(); - for (const auto& [_, entry] : sharedCache.GetEntries()) + for (const auto& entry : sharedCache.GetEntries()) sharedCache.ProcessEntryRegions(entry); auto endTime = std::chrono::high_resolution_clock::now(); std::chrono::duration elapsed = endTime - startTime; -- cgit v1.3.1