浏览代码

Replace while loop with member insert.

Stephen Kelly 10 年之前
父节点
当前提交
63f584b618
共有 2 个文件被更改,包括 2 次插入16 次删除
  1. 1 8
      Source/cmSetTargetPropertiesCommand.cxx
  2. 1 8
      Source/cmSetTestsPropertiesCommand.cxx

+ 1 - 8
Source/cmSetTargetPropertiesCommand.cxx

@@ -40,14 +40,7 @@ bool cmSetTargetPropertiesCommand
         this->SetError("called with incorrect number of arguments.");
         return false;
         }
-      while (j != args.end())
-        {
-        propertyPairs.push_back(*j);
-        ++j;
-        propertyPairs.push_back(*j);
-        ++j;
-        }
-      // break out of the loop because j is already == end
+      propertyPairs.insert(propertyPairs.end(), j, args.end());
       break;
       }
     else if (doingFiles)

+ 1 - 8
Source/cmSetTestsPropertiesCommand.cxx

@@ -41,14 +41,7 @@ bool cmSetTestsPropertiesCommand
         this->SetError("called with incorrect number of arguments.");
         return false;
         }
-      while (j != args.end())
-        {
-        propertyPairs.push_back(*j);
-        ++j;
-        propertyPairs.push_back(*j);
-        ++j;
-        }
-      // break out of the loop because j is already == end
+      propertyPairs.insert(propertyPairs.end(), j, args.end());
       break;
       }
     else if (doingFiles)