mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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.
This commit is contained in:
@ -95,15 +95,11 @@ void GraphicsModGroupConfig::Load()
|
|||||||
GraphicsModConfig::Source source) {
|
GraphicsModConfig::Source source) {
|
||||||
auto file = dir + DIR_SEP + "metadata.json";
|
auto file = dir + DIR_SEP + "metadata.json";
|
||||||
UnifyPathSeparators(file);
|
UnifyPathSeparators(file);
|
||||||
if (known_paths.find(file) != known_paths.end())
|
if (known_paths.contains(file))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
const auto mod = GraphicsModConfig::Create(file, source);
|
if (auto mod = GraphicsModConfig::Create(file, source))
|
||||||
if (mod)
|
m_graphics_mods.push_back(std::move(*mod));
|
||||||
{
|
|
||||||
m_graphics_mods.push_back(*mod);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::set<std::string> graphics_mod_user_directories =
|
const std::set<std::string> graphics_mod_user_directories =
|
||||||
|
Reference in New Issue
Block a user