Cache APP_SETTINGS lookups
These are essentially singletons
This commit is contained in:
parent
045160d486
commit
5e6b02f2d3
|
@ -85,7 +85,10 @@ public:
|
||||||
template<typename AppSettings>
|
template<typename AppSettings>
|
||||||
AppSettings* GetAppSettings( bool aLoadNow = true )
|
AppSettings* GetAppSettings( bool aLoadNow = true )
|
||||||
{
|
{
|
||||||
AppSettings* ret = nullptr;
|
static AppSettings* ret = nullptr;
|
||||||
|
|
||||||
|
if( ret )
|
||||||
|
return ret;
|
||||||
|
|
||||||
auto it = std::find_if( m_settings.begin(), m_settings.end(),
|
auto it = std::find_if( m_settings.begin(), m_settings.end(),
|
||||||
[]( const std::unique_ptr<JSON_SETTINGS>& aSettings )
|
[]( const std::unique_ptr<JSON_SETTINGS>& aSettings )
|
||||||
|
|
Loading…
Reference in New Issue