diff options
| author | Lioncash <mai.iam2048@gmail.com> | 2024-01-31 12:20:11 -0500 |
|---|---|---|
| committer | Lioncash <mai.iam2048@gmail.com> | 2024-01-31 12:23:21 -0500 |
| commit | ccacda5e2c4aed03ea75ef17d8f73376464a7b00 (patch) | |
| tree | 874784dc8468923499416ed4aac5a938c21762a1 /Source/Core/VideoCommon/GraphicsModSystem | |
| parent | 81aca79145c1f4618d2f7e3ba41e8840e2d98684 (diff) | |
GraphicsModGroup: Simplify try_add_mod()
We can use contains() here, and also move the mod config if it's valid
instead of copying it, since it contains quite a bit of allocated data.
Diffstat (limited to 'Source/Core/VideoCommon/GraphicsModSystem')
| -rw-r--r-- | Source/Core/VideoCommon/GraphicsModSystem/Config/GraphicsModGroup.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Config/GraphicsModGroup.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Config/GraphicsModGroup.cpp index 2e8459dfe4..f200604503 100644 --- a/Source/Core/VideoCommon/GraphicsModSystem/Config/GraphicsModGroup.cpp +++ b/Source/Core/VideoCommon/GraphicsModSystem/Config/GraphicsModGroup.cpp @@ -95,15 +95,11 @@ void GraphicsModGroupConfig::Load() GraphicsModConfig::Source source) { auto file = dir + DIR_SEP + "metadata.json"; UnifyPathSeparators(file); - if (known_paths.find(file) != known_paths.end()) - { + if (known_paths.contains(file)) return; - } - const auto mod = GraphicsModConfig::Create(file, source); - if (mod) - { - m_graphics_mods.push_back(*mod); - } + + if (auto mod = GraphicsModConfig::Create(file, source)) + m_graphics_mods.push_back(std::move(*mod)); }; const std::set<std::string> graphics_mod_user_directories = |
