refactor(Core/Common): restyle common lib with astyle (#3461)

This commit is contained in:
Kargatum
2020-09-12 03:50:48 +07:00
committed by GitHub
parent e15a493927
commit 3a0b0356ac
101 changed files with 4524 additions and 4418 deletions

View File

@@ -6,22 +6,23 @@
#include "Common.h"
char const* localeNames[TOTAL_LOCALES] = {
"enUS",
"koKR",
"frFR",
"deDE",
"zhCN",
"zhTW",
"esES",
"esMX",
"ruRU"
char const* localeNames[TOTAL_LOCALES] =
{
"enUS",
"koKR",
"frFR",
"deDE",
"zhCN",
"zhTW",
"esES",
"esMX",
"ruRU"
};
LocaleConstant GetLocaleByName(const std::string& name)
{
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
if (name==localeNames[i])
if (name == localeNames[i])
return LocaleConstant(i);
return LOCALE_enUS; // including enGB case
@@ -30,8 +31,8 @@ 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);
}