parent
34dccbf935
commit
ae417fc14c
|
@ -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<std::string> 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));
|
||||
}
|
||||
|
|
|
@ -77,8 +77,9 @@ void MemFree(void *p) {
|
|||
|
||||
std::vector<std::string> InitPlatform(int argc, char **argv) {
|
||||
std::vector<std::string> args;
|
||||
args.reserve(argc);
|
||||
for(int i = 0; i < argc; i++) {
|
||||
args.push_back(argv[i]);
|
||||
args.emplace_back(argv[i]);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue