mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
Optimize container insertions using emplace_back instead of push_back
This commit is contained in:
parent
f25a425cb9
commit
e98fb9a1a7
9 changed files with 13 additions and 13 deletions
|
|
@ -403,7 +403,7 @@ std::vector<std::string> util::split(const std::string& str, char delimiter) {
|
|||
result.push_back(tmp);
|
||||
}
|
||||
if (result.empty()) {
|
||||
result.push_back("");
|
||||
result.emplace_back("");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -420,7 +420,7 @@ std::vector<std::wstring> util::split(const std::wstring& str, char delimiter) {
|
|||
result.push_back(tmp);
|
||||
}
|
||||
if (result.empty()) {
|
||||
result.push_back(L"");
|
||||
result.emplace_back(L"");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue