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.
This commit is contained in:
parent
da03ff2e25
commit
93f49b1ca4
|
@ -62,12 +62,14 @@ void Load()
|
||||||
{
|
{
|
||||||
for (auto& layer : s_layers)
|
for (auto& layer : s_layers)
|
||||||
layer.second->Load();
|
layer.second->Load();
|
||||||
|
InvokeConfigChangedCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Save()
|
void Save()
|
||||||
{
|
{
|
||||||
for (auto& layer : s_layers)
|
for (auto& layer : s_layers)
|
||||||
layer.second->Save();
|
layer.second->Save();
|
||||||
|
InvokeConfigChangedCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
|
|
|
@ -115,7 +115,6 @@ void Layer::Load()
|
||||||
if (m_loader)
|
if (m_loader)
|
||||||
m_loader->Load(this);
|
m_loader->Load(this);
|
||||||
m_is_dirty = false;
|
m_is_dirty = false;
|
||||||
InvokeConfigChangedCallbacks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::Save()
|
void Layer::Save()
|
||||||
|
@ -125,7 +124,6 @@ void Layer::Save()
|
||||||
|
|
||||||
m_loader->Save(this);
|
m_loader->Save(this);
|
||||||
m_is_dirty = false;
|
m_is_dirty = false;
|
||||||
InvokeConfigChangedCallbacks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerType Layer::GetLayer() const
|
LayerType Layer::GetLayer() const
|
||||||
|
|
Loading…
Reference in New Issue