Ninja: Replace array access with local variable

This commit is contained in:
Stephen Kelly
2016-10-04 22:56:31 +02:00
parent d92c160db3
commit d9fde87d1a
+4 -4
View File
@@ -488,13 +488,13 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
std::string output; std::string output;
const std::vector<std::string>& outputs = ccg.GetOutputs(); const std::vector<std::string>& outputs = ccg.GetOutputs();
if (!outputs.empty()) { if (!outputs.empty()) {
output = outputs[0];
if (ccg.GetWorkingDirectory().empty()) { if (ccg.GetWorkingDirectory().empty()) {
output = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), output =
outputs[0]); this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), output);
output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
} else { } else {
output = output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
} }
} }
vars.Output = output.c_str(); vars.Output = output.c_str();