mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-08 04:32:00 +01:00
Performance improvements
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include "../SampleFormat.h"
|
||||
#include "../Track.h"
|
||||
|
||||
bool XMLValueChecker::IsGoodString(const wxString str)
|
||||
bool XMLValueChecker::IsGoodString(const wxString & str)
|
||||
{
|
||||
size_t len = str.Length();
|
||||
int nullIndex = str.Find('\0', false);
|
||||
@@ -50,7 +50,7 @@ bool XMLValueChecker::IsGoodString(const wxString str)
|
||||
}
|
||||
|
||||
// "Good" means the name is well-formed and names an existing file or folder.
|
||||
bool XMLValueChecker::IsGoodFileName(const wxString strFileName, const wxString strDirName /* = "" */)
|
||||
bool XMLValueChecker::IsGoodFileName(const wxString & strFileName, const wxString & strDirName /* = "" */)
|
||||
{
|
||||
// Test strFileName.
|
||||
if (!IsGoodFileString(strFileName) ||
|
||||
@@ -74,7 +74,7 @@ bool XMLValueChecker::IsGoodFileString(wxString str)
|
||||
(str.Find(wxFileName::GetPathSeparator()) == -1)); // No path separator characters.
|
||||
}
|
||||
|
||||
bool XMLValueChecker::IsGoodSubdirName(const wxString strSubdirName, const wxString strDirName /* = "" */)
|
||||
bool XMLValueChecker::IsGoodSubdirName(const wxString & strSubdirName, const wxString & strDirName /* = "" */)
|
||||
{
|
||||
// Test strSubdirName.
|
||||
// Note this prevents path separators, and relative path to parents (strDirName),
|
||||
@@ -90,7 +90,7 @@ bool XMLValueChecker::IsGoodSubdirName(const wxString strSubdirName, const wxStr
|
||||
return (fileName.IsOk() && fileName.DirExists());
|
||||
}
|
||||
|
||||
bool XMLValueChecker::IsGoodPathName(const wxString strPathName)
|
||||
bool XMLValueChecker::IsGoodPathName(const wxString & strPathName)
|
||||
{
|
||||
// Test the corresponding wxFileName.
|
||||
wxFileName fileName(strPathName);
|
||||
@@ -105,7 +105,7 @@ bool XMLValueChecker::IsGoodPathString(wxString str)
|
||||
}
|
||||
|
||||
|
||||
bool XMLValueChecker::IsGoodInt(const wxString strInt)
|
||||
bool XMLValueChecker::IsGoodInt(const wxString & strInt)
|
||||
{
|
||||
if (!IsGoodString(strInt))
|
||||
return false;
|
||||
@@ -146,7 +146,7 @@ bool XMLValueChecker::IsGoodInt(const wxString strInt)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool XMLValueChecker::IsGoodInt64(const wxString strInt)
|
||||
bool XMLValueChecker::IsGoodInt64(const wxString & strInt)
|
||||
{
|
||||
if (!IsGoodString(strInt))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user