From c1cf7c32c3d01a1dbb755f1d7024be116acde5ac Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 5 Aug 2018 00:06:54 +0100 Subject: [PATCH] Performance enhancement: don't process envvars in configs. --- common/bin_mod.cpp | 3 +++ common/project.cpp | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/bin_mod.cpp b/common/bin_mod.cpp index 116bc206f6..da2aa92608 100644 --- a/common/bin_mod.cpp +++ b/common/bin_mod.cpp @@ -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 diff --git a/common/project.cpp b/common/project.cpp index 7243b18a8b..0dc2883cec 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -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; }