refactor(Core): apply clang-tidy modernize-use-emplace (#3828)

This commit is contained in:
Francesco Borzì
2020-12-07 18:25:55 +01:00
committed by GitHub
parent 3469115f4d
commit 0b7b36f20c
3 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -197,7 +197,7 @@ namespace MMAP
for (unsigned int i = 0; i < threads; ++i) for (unsigned int i = 0; i < threads; ++i)
{ {
_workerThreads.push_back(std::thread(&MapBuilder::WorkerThread, this)); _workerThreads.emplace_back(&MapBuilder::WorkerThread, this);
} }
m_tiles.sort([](MapTiles a, MapTiles b) m_tiles.sort([](MapTiles a, MapTiles b)
+1 -1
View File
@@ -108,7 +108,7 @@ namespace MMAP
if ((dp = readdir(dirp)) != nullptr) if ((dp = readdir(dirp)) != nullptr)
{ {
if (matchWildcardFilter(filter.c_str(), dp->d_name)) if (matchWildcardFilter(filter.c_str(), dp->d_name))
fileList.push_back(std::string(dp->d_name)); fileList.emplace_back(dp->d_name);
} }
else else
break; break;
+13 -13
View File
@@ -283,7 +283,7 @@ bool scan_patches(char* scanmatch, std::vector<std::string>& pArchiveNames)
{ {
fclose(h); fclose(h);
//matches.push_back(path); //matches.push_back(path);
pArchiveNames.push_back(path); pArchiveNames.emplace_back(path);
} }
} }
@@ -301,18 +301,18 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames)
string in_path(input_path); string in_path(input_path);
std::vector<std::string> locales, searchLocales; std::vector<std::string> locales, searchLocales;
searchLocales.push_back("enGB"); searchLocales.emplace_back("enGB");
searchLocales.push_back("enUS"); searchLocales.emplace_back("enUS");
searchLocales.push_back("deDE"); searchLocales.emplace_back("deDE");
searchLocales.push_back("esES"); searchLocales.emplace_back("esES");
searchLocales.push_back("frFR"); searchLocales.emplace_back("frFR");
searchLocales.push_back("koKR"); searchLocales.emplace_back("koKR");
searchLocales.push_back("zhCN"); searchLocales.emplace_back("zhCN");
searchLocales.push_back("zhTW"); searchLocales.emplace_back("zhTW");
searchLocales.push_back("enCN"); searchLocales.emplace_back("enCN");
searchLocales.push_back("enTW"); searchLocales.emplace_back("enTW");
searchLocales.push_back("esMX"); searchLocales.emplace_back("esMX");
searchLocales.push_back("ruRU"); searchLocales.emplace_back("ruRU");
for (std::vector<std::string>::iterator i = searchLocales.begin(); i != searchLocales.end(); ++i) for (std::vector<std::string>::iterator i = searchLocales.begin(); i != searchLocales.end(); ++i)
{ {