1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Preallocate string for aud-do

Helps marginally with speed of commands which generate long strings in many small steps.
This commit is contained in:
James Crook
2020-02-06 09:39:37 +00:00
parent a09885e995
commit f3acd4ca00
2 changed files with 8 additions and 1 deletions

View File

@@ -349,6 +349,10 @@ LongMessageDialog::LongMessageDialog(wxWindow * parent,
mType = type;
mAdditionalButtons = additionalButtons;
SetName(XO("Long Message"));
// The long message adds lots of short strings onto this one.
// So preallocate to make it faster.
// Needs 37Kb for all commands.
mText.Alloc(40000);
}
LongMessageDialog::~LongMessageDialog(){

View File

@@ -231,7 +231,10 @@ public:
ResponseQueueTarget()
: mBuffer( wxEmptyString )
{ }
{
// Cater for handling long responses quickly.
mBuffer.Alloc(40000);
}
virtual ~ResponseQueueTarget()
{
if( mBuffer.StartsWith("\n" ) )