Better readability and optimization insertion into container by replacing 'insert' -> 'emplace', 'push_back' -> 'emplace_back'

This commit is contained in:
lainon committed 2022-09-30 12:35:28 +03:00
1 parent c953bf7fc7
commit 3cdf72b68b
20 files changed
+49 -49

No files matched your search

+2 -2
View File
@@ -206,7 +206,7 @@ void Section::Set(const char* key, const char* newValue)
else
{
// The key did not already exist in this section - let's add it.
lines.push_back(std::string(key) + " = " + EscapeComments(newValue));
lines.emplace_back(std::string(key) + " = " + EscapeComments(newValue));
}
}
@@ -272,7 +272,7 @@ void Section::Set(const char* key, const std::vector<std::string>& newValues)
}
void Section::AddComment(const std::string &comment) {
lines.push_back("# " + comment);
lines.emplace_back("# " + comment);
}
bool Section::Get(const char* key, std::vector<std::string>& values)