From ff38362216ff3e73eb99f7fda90ec802da1386ff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 11 Dec 2023 11:12:06 -0500 Subject: [PATCH] GameFileCache: Use std::span with Update() All we're really doing is iterating over a sequence of strings, so we don't need to tie this specifically to std::vector. --- Source/Core/UICommon/GameFileCache.cpp | 2 +- Source/Core/UICommon/GameFileCache.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/UICommon/GameFileCache.cpp b/Source/Core/UICommon/GameFileCache.cpp index 1435154941..2838d331d8 100644 --- a/Source/Core/UICommon/GameFileCache.cpp +++ b/Source/Core/UICommon/GameFileCache.cpp @@ -83,7 +83,7 @@ std::shared_ptr GameFileCache::AddOrGet(const std::string& path, return result; } -bool GameFileCache::Update(const std::vector& all_game_paths, +bool GameFileCache::Update(std::span all_game_paths, const GameAddedToCacheFn& game_added_to_cache, const GameRemovedFromCacheFn& game_removed_from_cache, const std::atomic_bool& processing_halted) diff --git a/Source/Core/UICommon/GameFileCache.h b/Source/Core/UICommon/GameFileCache.h index ac8ae7b177..5544b3a143 100644 --- a/Source/Core/UICommon/GameFileCache.h +++ b/Source/Core/UICommon/GameFileCache.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -46,7 +47,7 @@ public: std::shared_ptr AddOrGet(const std::string& path, bool* cache_changed); // These functions return true if the call modified the cache. - bool Update(const std::vector& all_game_paths, + bool Update(std::span all_game_paths, const GameAddedToCacheFn& game_added_to_cache = {}, const GameRemovedFromCacheFn& game_removed_from_cache = {}, const std::atomic_bool& processing_halted = false);