mirror of https://github.com/AxioDL/metaforce.git
Function-scope statics aren't as efficient as file-scope ones
This commit is contained in:
parent
1404f84480
commit
037404c5ff
|
@ -28,11 +28,9 @@ public:
|
||||||
hecl::SystemString firstArg = info.args.front();
|
hecl::SystemString firstArg = info.args.front();
|
||||||
hecl::ToLower(firstArg);
|
hecl::ToLower(firstArg);
|
||||||
|
|
||||||
static const hecl::SystemString enable(_S("enable"));
|
if (!firstArg.compare(_S("enable")))
|
||||||
static const hecl::SystemString disable(_S("disable"));
|
|
||||||
if (!firstArg.compare(enable))
|
|
||||||
mode = MENABLE;
|
mode = MENABLE;
|
||||||
else if (!firstArg.compare(disable))
|
else if (!firstArg.compare(_S("disable")))
|
||||||
mode = MDISABLE;
|
mode = MDISABLE;
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace Database
|
||||||
{
|
{
|
||||||
|
|
||||||
logvisor::Module LogModule("HECLDatabase");
|
logvisor::Module LogModule("HECLDatabase");
|
||||||
|
static const hecl::FourCC HECLfcc("HECL");
|
||||||
|
|
||||||
/**********************************************
|
/**********************************************
|
||||||
* Project::ConfigFile
|
* Project::ConfigFile
|
||||||
|
@ -231,7 +232,6 @@ Project::Project(const ProjectRootPath& rootPath)
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
} beacon;
|
} beacon;
|
||||||
#define DATA_VERSION 1
|
#define DATA_VERSION 1
|
||||||
static const hecl::FourCC HECLfcc("HECL");
|
|
||||||
if (fread(&beacon, 1, sizeof(beacon), bf) != sizeof(beacon))
|
if (fread(&beacon, 1, sizeof(beacon), bf) != sizeof(beacon))
|
||||||
{
|
{
|
||||||
fseek(bf, 0, SEEK_SET);
|
fseek(bf, 0, SEEK_SET);
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace hecl
|
||||||
{
|
{
|
||||||
unsigned VerbosityLevel = 0;
|
unsigned VerbosityLevel = 0;
|
||||||
logvisor::Module LogModule("hecl");
|
logvisor::Module LogModule("hecl");
|
||||||
|
static const std::string Illegals {"<>?*\"|"};
|
||||||
|
|
||||||
void SanitizePath(std::string& path)
|
void SanitizePath(std::string& path)
|
||||||
{
|
{
|
||||||
|
@ -31,8 +32,7 @@ void SanitizePath(std::string& path)
|
||||||
bool ic = false;
|
bool ic = false;
|
||||||
std::transform(path.begin(), path.end(), path.begin(), [&](const char a) -> char {
|
std::transform(path.begin(), path.end(), path.begin(), [&](const char a) -> char {
|
||||||
++p1;
|
++p1;
|
||||||
static const std::string illegals {"<>?*\"|"};
|
if (Illegals.find_first_of(a) != std::string::npos)
|
||||||
if (illegals.find_first_of(a) != std::string::npos)
|
|
||||||
{
|
{
|
||||||
ic = false;
|
ic = false;
|
||||||
return '_';
|
return '_';
|
||||||
|
@ -52,6 +52,8 @@ void SanitizePath(std::string& path)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const std::wstring WIllegals {L"<>?*\"|"};
|
||||||
|
|
||||||
void SanitizePath(std::wstring& path)
|
void SanitizePath(std::wstring& path)
|
||||||
{
|
{
|
||||||
if (path.empty())
|
if (path.empty())
|
||||||
|
@ -62,8 +64,7 @@ void SanitizePath(std::wstring& path)
|
||||||
bool ic = false;
|
bool ic = false;
|
||||||
std::transform(path.begin(), path.end(), path.begin(), [&](const wchar_t a) -> wchar_t {
|
std::transform(path.begin(), path.end(), path.begin(), [&](const wchar_t a) -> wchar_t {
|
||||||
++p1;
|
++p1;
|
||||||
static const std::wstring illegals {L"<>?*\"|"};
|
if (WIllegals.find_first_of(a) != std::wstring::npos)
|
||||||
if (illegals.find_first_of(a) != std::wstring::npos)
|
|
||||||
{
|
{
|
||||||
ic = false;
|
ic = false;
|
||||||
return L'_';
|
return L'_';
|
||||||
|
|
Loading…
Reference in New Issue