Performance enhancement: don't process envvars in configs.

This commit is contained in:
Jeff Young 2018-08-05 00:06:54 +01:00
parent 0cd75b2556
commit c1cf7c32c3
2 changed files with 6 additions and 6 deletions

View File

@ -38,6 +38,9 @@ void BIN_MOD::Init()
// do an OS specific wxConfig instantiation, using the bin_mod (EXE/DLL/DSO) name.
m_config = GetNewConfig( wxString::FromUTF8( m_name ) );
// wxWidgets' implementation of this is *very* expensive, and we don't use them anyway.
m_config->SetExpandEnvVars( false );
m_history.Load( *m_config );
// Prepare On Line Help. Use only lower case for help file names, in order to

View File

@ -362,20 +362,17 @@ bool PROJECT::ConfigLoad( const SEARCH_STACK& aSList, const wxString& aGroupNam
return false;
}
// We do not want expansion of env var values when reading our project config file
cfg.get()->SetExpandEnvVars( false );
cfg->SetPath( wxCONFIG_PATH_SEPARATOR );
wxString timestamp = cfg->Read( wxT( "update" ) );
m_pro_date_and_time = timestamp;
// We do not want expansion of env var values when reading our project config file
bool state = cfg.get()->IsExpandingEnvVars();
cfg.get()->SetExpandEnvVars( false );
wxConfigLoadParams( cfg.get(), aParams, aGroupName );
cfg.get()->SetExpandEnvVars( state );
return true;
}