Bladeren bron

Take computation out of loop.

Stephen Kelly 10 jaren geleden
bovenliggende
commit
d59913f001
1 gewijzigde bestanden met toevoegingen van 3 en 1 verwijderingen
  1. 3 1
      Source/cmLocalUnixMakefileGenerator3.cxx

+ 3 - 1
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -2393,11 +2393,13 @@ void cmLocalUnixMakefileGenerator3
     // On UNIX we must construct a single shell command to change
     // On UNIX we must construct a single shell command to change
     // directory and build because make resets the directory between
     // directory and build because make resets the directory between
     // each command.
     // each command.
+    std::string outputForExisting =
+                          this->ConvertToOutputForExisting(tgtDir, relRetDir);
     std::vector<std::string>::iterator i = commands.begin();
     std::vector<std::string>::iterator i = commands.begin();
     for (; i != commands.end(); ++i)
     for (; i != commands.end(); ++i)
       {
       {
       std::string cmd = cd_cmd;
       std::string cmd = cd_cmd;
-      cmd += this->ConvertToOutputForExisting(tgtDir, relRetDir);
+      cmd += outputForExisting;
       cmd += " && ";
       cmd += " && ";
       cmd += *i;
       cmd += *i;
       *i = cmd;
       *i = cmd;