Performance enhancements.

This commit is contained in:
Jeff Young
2020-04-24 22:17:45 +01:00
parent 32db9eb0f1
commit 2fb2eac4d5
8 changed files with 73 additions and 41 deletions
+3 -1
View File
@@ -379,6 +379,8 @@ wxString ExpandTextVars( const wxString& aSource,
wxString newbuf;
size_t sourceLen = aSource.length();
newbuf.Alloc( sourceLen ); // best guess (improves performance)
for( size_t i = 0; i < sourceLen; ++i )
{
if( aSource[i] == '$' && i + 1 < sourceLen && aSource[i+1] == '{' )
@@ -428,7 +430,7 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject )
size_t strlen = str.length();
wxString strResult;
strResult.Alloc( strlen );
strResult.Alloc( strlen ); // best guess (improves performance)
for( size_t n = 0; n < strlen; n++ )
{