From f5fd183571af0eb688536dbc3175edcd8c7a1d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 31 Jul 2017 16:26:46 +0800 Subject: 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. --- Source/Core/Common/Config/Config.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'Source/Core/Common/Config/Config.cpp') diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp index 285db95f28..dcdcf4ba8f 100644 --- a/Source/Core/Common/Config/Config.cpp +++ b/Source/Core/Common/Config/Config.cpp @@ -38,17 +38,6 @@ void AddLayer(std::unique_ptr loader) AddLayer(std::make_unique(std::move(loader))); } -void AddLoadLayer(std::unique_ptr layer) -{ - layer->Load(); - AddLayer(std::move(layer)); -} - -void AddLoadLayer(std::unique_ptr loader) -{ - AddLoadLayer(std::make_unique(std::move(loader))); -} - Layer* GetLayer(LayerType layer) { if (!LayerExists(layer)) -- cgit v1.2.3