瀏覽代碼

Convert raw loops to set member insert.

Stephen Kelly 10 年之前
父節點
當前提交
92a37f9279
共有 2 個文件被更改,包括 3 次插入10 次删除
  1. 2 6
      Source/cmGeneratorExpression.cxx
  2. 1 4
      Source/cmLoadCacheCommand.cxx

+ 2 - 6
Source/cmGeneratorExpression.cxx

@@ -98,12 +98,8 @@ const char *cmCompiledGeneratorExpression::Evaluate(
     {
     this->Output += (*it)->Evaluate(&context, dagChecker);
 
-    for(std::set<std::string>::const_iterator
-          p = context.SeenTargetProperties.begin();
-          p != context.SeenTargetProperties.end(); ++p)
-      {
-      this->SeenTargetProperties.insert(*p);
-      }
+    this->SeenTargetProperties.insert(context.SeenTargetProperties.begin(),
+                                      context.SeenTargetProperties.end());
     if (context.HadError)
       {
       this->Output = "";

+ 1 - 4
Source/cmLoadCacheCommand.cxx

@@ -110,10 +110,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
 
   // Prepare the table of variables to read.
   this->Prefix = args[2];
-  for(unsigned int i=3; i < args.size(); ++i)
-    {
-    this->VariablesToRead.insert(args[i]);
-    }
+  this->VariablesToRead.insert(args.begin() + 3, args.end());
 
   // Read the cache file.
   cmsys::ifstream fin(cacheFile.c_str());