1
0
Эх сурвалжийг харах

Makefiles: Replace array access with local variable

Stephen Kelly 9 жил өмнө
parent
commit
378849f41e

+ 6 - 5
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -995,14 +995,15 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
         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 (workingDir.empty()) {
           if (workingDir.empty()) {
             output = this->MaybeConvertToRelativePath(
             output = this->MaybeConvertToRelativePath(
-              this->GetCurrentBinaryDirectory(), outputs[0]);
-            output = this->ConvertToOutputFormat(output,
-              cmOutputConverter::SHELL);
+              this->GetCurrentBinaryDirectory(), output);
+            output =
+              this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
           } else {
           } else {
-            output = this->ConvertToOutputFormat(outputs[0],
-                                                 cmOutputConverter::SHELL);
+            output =
+              this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
           }
           }
         }
         }
         vars.Output = output.c_str();
         vars.Output = output.c_str();