mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-03 19:42:45 +01:00
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.
This commit is contained in:
parent
2ca80adeb2
commit
ff38362216
@ -83,7 +83,7 @@ std::shared_ptr<const GameFile> GameFileCache::AddOrGet(const std::string& path,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameFileCache::Update(const std::vector<std::string>& all_game_paths,
|
bool GameFileCache::Update(std::span<const std::string> all_game_paths,
|
||||||
const GameAddedToCacheFn& game_added_to_cache,
|
const GameAddedToCacheFn& game_added_to_cache,
|
||||||
const GameRemovedFromCacheFn& game_removed_from_cache,
|
const GameRemovedFromCacheFn& game_removed_from_cache,
|
||||||
const std::atomic_bool& processing_halted)
|
const std::atomic_bool& processing_halted)
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <span>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ public:
|
|||||||
std::shared_ptr<const GameFile> AddOrGet(const std::string& path, bool* cache_changed);
|
std::shared_ptr<const GameFile> AddOrGet(const std::string& path, bool* cache_changed);
|
||||||
|
|
||||||
// These functions return true if the call modified the cache.
|
// These functions return true if the call modified the cache.
|
||||||
bool Update(const std::vector<std::string>& all_game_paths,
|
bool Update(std::span<const std::string> all_game_paths,
|
||||||
const GameAddedToCacheFn& game_added_to_cache = {},
|
const GameAddedToCacheFn& game_added_to_cache = {},
|
||||||
const GameRemovedFromCacheFn& game_removed_from_cache = {},
|
const GameRemovedFromCacheFn& game_removed_from_cache = {},
|
||||||
const std::atomic_bool& processing_halted = false);
|
const std::atomic_bool& processing_halted = false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user