1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-08 08:01:19 +02:00

Slightly faster parsing of Nyquist programs.

This reads the program into a buffer first.
It also preallocates space for the Nyquist program.
This commit is contained in:
James Crook 2020-02-21 15:38:49 +00:00
parent f5b8b4028b
commit 3332c9451e

View File

@ -2177,6 +2177,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
wxTextInputStream pgm(stream, wxT(" \t"), wxConvAuto()); wxTextInputStream pgm(stream, wxT(" \t"), wxConvAuto());
mCmd = wxT(""); mCmd = wxT("");
mCmd.Alloc(10000);
mIsSal = false; mIsSal = false;
mControls.clear(); mControls.clear();
mCategories.clear(); mCategories.clear();
@ -2261,7 +2262,8 @@ or for LISP, begin with an open parenthesis such as:\n\t(mult *track* 0.1)\n .")
void NyquistEffect::ParseFile() void NyquistEffect::ParseFile()
{ {
wxFileInputStream stream(mFileName.GetFullPath()); wxFileInputStream rawStream(mFileName.GetFullPath());
wxBufferedInputStream stream(rawStream, 10000);
ParseProgram(stream); ParseProgram(stream);
} }