1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

Source: Minor optimizations

This commit is contained in:
AJIOB
2025-09-23 15:42:18 +03:00
committed by Brad King
parent 73fa6ab3e6
commit 2cae68ecbe
3 changed files with 7 additions and 7 deletions

View File

@@ -81,7 +81,7 @@ static void CreatePropertyGeneratorExpressions(
bool evaluateForBuildsystem = false)
{
for (auto const& entry : entries) {
items.push_back(cmGeneratorTarget::TargetPropertyEntry::Create(
items.emplace_back(cmGeneratorTarget::TargetPropertyEntry::Create(
cmakeInstance, entry, evaluateForBuildsystem));
}
}

View File

@@ -76,15 +76,15 @@ void processOptions(cmGeneratorTarget const* tgt,
options.emplace_back(opt, entry.Backtrace);
}
if (debugOptions) {
usedOptions += " * " + opt + "\n";
usedOptions += cmStrCat(" * ", opt, '\n');
}
}
}
if (!usedOptions.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
MessageType::LOG,
std::string("Used ") + logName + std::string(" for target ") +
tgt->GetName() + ":\n" + usedOptions,
cmStrCat("Used ", logName, " for target ", tgt->GetName(), ":\n",
usedOptions),
entry.Backtrace);
}
}
@@ -305,7 +305,7 @@ void cmGeneratorTarget::GetCompileDefinitions(
{
std::vector<BT<std::string>> tmp =
this->GetCompileDefinitions(config, language);
result.reserve(tmp.size());
result.reserve(result.size() + tmp.size());
for (BT<std::string>& v : tmp) {
result.emplace_back(std::move(v.Value));
}

View File

@@ -62,7 +62,7 @@ void cmIDEOptions::HandleFlag(std::string const& flag)
this->DoingDefine = true;
} else {
// Store this definition.
this->Defines.push_back(flag.substr(2));
this->Defines.emplace_back(flag.substr(2));
}
return;
}
@@ -73,7 +73,7 @@ void cmIDEOptions::HandleFlag(std::string const& flag)
this->DoingInclude = true;
} else {
// Store this include directory.
this->Includes.push_back(flag.substr(2));
this->Includes.emplace_back(flag.substr(2));
}
return;
}