Explorar o código

Convert loop to algorithm.

Stephen Kelly %!s(int64=10) %!d(string=hai) anos
pai
achega
a7fcc148bd
Modificáronse 1 ficheiros con 2 adicións e 5 borrados
  1. 2 5
      Source/cmLocalUnixMakefileGenerator3.cxx

+ 2 - 5
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -2396,10 +2396,7 @@ void cmLocalUnixMakefileGenerator3
     std::string outputForExisting =
                           this->ConvertToOutputForExisting(tgtDir, relRetDir);
     std::string prefix = cd_cmd + outputForExisting + " && ";
-    std::vector<std::string>::iterator i = commands.begin();
-    for (; i != commands.end(); ++i)
-      {
-      *i = prefix + *i;
-      }
+    std::transform(commands.begin(), commands.end(), commands.begin(),
+                   std::bind1st(std::plus<std::string>(), prefix));
     }
 }