summaryrefslogtreecommitdiffstats
path: root/Source/cmConditionEvaluator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-11-22 10:00:45 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-01-11 16:00:55 (GMT)
commit238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 (patch)
tree2ad1d3c2057e6d568fb55da0a9b872f992cb06d6 /Source/cmConditionEvaluator.cxx
parent2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 (diff)
downloadCMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.zip
CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.tar.gz
CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.tar.bz2
Use insert instead of a loop in some cases.
Limit this change to inserting into a vector from a vector. A follow up change can use insert for inserting into a set.
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r--Source/cmConditionEvaluator.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index aba26de..7a601e2 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -53,10 +53,7 @@ bool cmConditionEvaluator::IsTrue(
cmArgumentList newArgs;
// copy to the list structure
- for(unsigned int i = 0; i < args.size(); ++i)
- {
- newArgs.push_back(args[i]);
- }
+ newArgs.insert(newArgs.end(), args.begin(), args.end());
// now loop through the arguments and see if we can reduce any of them
// we do this multiple times. Once for each level of precedence
@@ -411,10 +408,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList &newArgs,
// copy to the list structure
cmArgumentList::iterator argP1 = arg;
argP1++;
- for(; argP1 != argClose; argP1++)
- {
- newArgs2.push_back(*argP1);
- }
+ newArgs2.insert(newArgs2.end(), argP1, argClose);
newArgs2.pop_back();
// now recursively invoke IsTrue to handle the values inside the
// parenthetical expression