Permalink
Browse files

Config: Make Load() and Save() slightly faster

Only invoke config changed callbacks from Config::Save, not
Layer::Save. The latter results in callbacks being called
once per layer, up to 7 times per save.
  • Loading branch information...
leoetlino committed Aug 4, 2017
1 parent da03ff2 commit 93f49b1ca4526b7e5d8fc3ba647347b1e0b9ef40
Showing with 2 additions and 2 deletions.
  1. +2 −0 Source/Core/Common/Config/Config.cpp
  2. +0 −2 Source/Core/Common/Config/Layer.cpp
@@ -62,12 +62,14 @@ void Load()
{
for (auto& layer : s_layers)
layer.second->Load();
InvokeConfigChangedCallbacks();
}
void Save()
{
for (auto& layer : s_layers)
layer.second->Save();
InvokeConfigChangedCallbacks();
}
void Init()
@@ -115,7 +115,6 @@ void Layer::Load()
if (m_loader)
m_loader->Load(this);
m_is_dirty = false;
InvokeConfigChangedCallbacks();
}
void Layer::Save()
@@ -125,7 +124,6 @@ void Layer::Save()
m_loader->Save(this);
m_is_dirty = false;
InvokeConfigChangedCallbacks();
}
LayerType Layer::GetLayer() const

0 comments on commit 93f49b1

Please sign in to comment.