瀏覽代碼

Ninja: Replace array access with local variable

Stephen Kelly 9 年之前
父節點
當前提交
d9fde87d1a
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      Source/cmLocalNinjaGenerator.cxx

+ 4 - 4
Source/cmLocalNinjaGenerator.cxx

@@ -488,13 +488,13 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
   std::string output;
   const std::vector<std::string>& outputs = ccg.GetOutputs();
   if (!outputs.empty()) {
+    output = outputs[0];
     if (ccg.GetWorkingDirectory().empty()) {
-      output = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
-                                           outputs[0]);
+      output =
+        this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), output);
       output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
     } else {
-      output =
-        this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
+      output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
     }
   }
   vars.Output = output.c_str();