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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -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));
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user