Config: Fix the loader Load() being called twice

The Config::AddLoadLayer functions call Load on the layer
explicitly, but Load is already called in the constructor,
so they'd cause the loader's Load function to be called twice,
which is potentially expensive considering we have to read an INI
from the host filesystem.

This commit removes the Config::AddLoadLayer functions because
they don't appear to be necessary.
This commit is contained in:
Léo Lam
2017-07-31 16:26:46 +08:00
parent ed331918f0
commit f5fd183571
4 changed files with 4 additions and 17 deletions

View File

@ -38,17 +38,6 @@ void AddLayer(std::unique_ptr<ConfigLayerLoader> loader)
AddLayer(std::make_unique<Layer>(std::move(loader)));
}
void AddLoadLayer(std::unique_ptr<Layer> layer)
{
layer->Load();
AddLayer(std::move(layer));
}
void AddLoadLayer(std::unique_ptr<ConfigLayerLoader> loader)
{
AddLoadLayer(std::make_unique<Layer>(std::move(loader)));
}
Layer* GetLayer(LayerType layer)
{
if (!LayerExists(layer))