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:
parent
81aca79145
commit
ccacda5e2c
|
@ -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 =
|
||||||
|
|
Loading…
Reference in New Issue