diff --git a/src/platform/platform.cpp b/src/platform/platform.cpp index 33b6579..e2382d4 100644 --- a/src/platform/platform.cpp +++ b/src/platform/platform.cpp @@ -295,7 +295,7 @@ Path Path::Expand(bool fromCurrentDirectory) const { if(expanded.IsEmpty()) { if(expandedComponents.empty()) { - expandedComponents.push_back("."); + expandedComponents.emplace_back("."); } expanded = From(Concat(expandedComponents, SEPARATOR)); } else if(!expandedComponents.empty()) { @@ -371,12 +371,12 @@ Path Path::RelativeTo(const Path &base) const { std::vector resultComponents; for(size_t i = common; i < baseComponents.size(); i++) { - resultComponents.push_back(".."); + resultComponents.emplace_back(".."); } resultComponents.insert(resultComponents.end(), components.begin() + common, components.end()); if(resultComponents.empty()) { - resultComponents.push_back("."); + resultComponents.emplace_back("."); } return From(Concat(resultComponents, SEPARATOR)); } diff --git a/src/platform/utilunix.cpp b/src/platform/utilunix.cpp index 0275bd6..bf7d7e3 100644 --- a/src/platform/utilunix.cpp +++ b/src/platform/utilunix.cpp @@ -77,8 +77,9 @@ void MemFree(void *p) { std::vector InitPlatform(int argc, char **argv) { std::vector args; + args.reserve(argc); for(int i = 0; i < argc; i++) { - args.push_back(argv[i]); + args.emplace_back(argv[i]); } return args; }