chore: use emplace_back where possible

This commit is contained in:
sithlord48
2025-05-21 23:02:08 -04:00
committed by Nick Bolton
parent 17f12d8334
commit 456afaa13e
2 changed files with 3 additions and 3 deletions

View File

@ -259,7 +259,7 @@ void ArgParser::splitCommandString(const std::string_view &command, std::vector<
auto subString = command.substr(startPos, space - startPos);
removeDoubleQuotes(subString);
argv.push_back(std::string{subString.begin(), subString.end()});
argv.emplace_back(subString);
}
// find next space
@ -273,7 +273,7 @@ void ArgParser::splitCommandString(const std::string_view &command, std::vector<
auto subString = command.substr(startPos, command.size());
removeDoubleQuotes(subString);
argv.push_back(std::string{subString.begin(), subString.end()});
argv.emplace_back(subString);
}
bool ArgParser::searchDoubleQuotes(const std::string_view &command, size_t &left, size_t &right, size_t startPos)

View File

@ -40,7 +40,7 @@ void LanguageManager::setRemoteLanguages(const std::string_view &remoteLanguages
if (!remoteLanguages.empty()) {
for (size_t i = 0; i <= remoteLanguages.size() - 2; i += 2) {
auto rLangs = remoteLanguages.substr(i, 2);
m_remoteLanguages.push_back(std::string{rLangs.begin(), rLangs.end()});
m_remoteLanguages.emplace_back(rLangs);
}
}
LOG((CLOG_INFO "remote languages: %s", vectorToString(m_remoteLanguages, ", ").c_str()));