refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
parent
33c271cc7c
commit
3c24b511f2
72 changed files with 1486 additions and 401 deletions
|
|
@ -23,7 +23,9 @@ LocaleConstant GetLocaleByName(const std::string& name)
|
|||
{
|
||||
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
|
||||
if (name == localeNames[i])
|
||||
{
|
||||
return LocaleConstant(i);
|
||||
}
|
||||
|
||||
return LOCALE_enUS; // including enGB case
|
||||
}
|
||||
|
|
@ -31,7 +33,7 @@ LocaleConstant GetLocaleByName(const std::string& name)
|
|||
void CleanStringForMysqlQuery(std::string& str)
|
||||
{
|
||||
std::string::size_type n = 0;
|
||||
while ((n = str.find('\\')) != str.npos) str.erase(n, 1);
|
||||
while ((n = str.find('"')) != str.npos) str.erase(n, 1);
|
||||
while ((n = str.find('\'')) != str.npos) str.erase(n, 1);
|
||||
while ((n = str.find('\\')) != str.npos) { str.erase(n, 1); }
|
||||
while ((n = str.find('"')) != str.npos) { str.erase(n, 1); }
|
||||
while ((n = str.find('\'')) != str.npos) { str.erase(n, 1); }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue