Jelajahi Sumber

cmLocalGenerator: Simplify CPATH lookup loop

Alexander Grund 4 tahun lalu
induk
melakukan
5c02964aff
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      Source/cmLocalGenerator.cxx

+ 2 - 3
Source/cmLocalGenerator.cxx

@@ -107,10 +107,9 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
   {
     std::vector<std::string> cpath;
     cmSystemTools::GetPath(cpath, "CPATH");
-    for (std::string& cp : cpath) {
+    for (std::string const& cp : cpath) {
       if (cmSystemTools::FileIsFullPath(cp)) {
-        cp = cmSystemTools::CollapseFullPath(cp);
-        this->EnvCPATH.emplace(std::move(cp));
+        this->EnvCPATH.emplace(cmSystemTools::CollapseFullPath(cp));
       }
     }
   }