diff options
author | Brad King <brad.king@kitware.com> | 2019-02-11 13:08:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-11 13:08:22 (GMT) |
commit | 4b37b4f1bb785a305ab742f37e5268d4cffef693 (patch) | |
tree | f9c6e15ac0925bfa8b15fce4c3475d3233a820f6 /Source/CTest | |
parent | 17de1eea806d7ba87a4ba6ad1073ced5f7ea9473 (diff) | |
parent | 01b2d6ab7465e7f22fb821876027df86b0c8f363 (diff) | |
download | CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.zip CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.gz CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.bz2 |
Merge topic 'modernize-for-loops'
01b2d6ab74 Modernize: Use ranged for-loops when possible
15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !2901
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestP4.cxx | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 756ac6c..63c2fcc 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -3,6 +3,7 @@ #include "cmCTestMultiProcessHandler.h" #include "cmAffinity.h" +#include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestRunTest.h" #include "cmCTestTestHandler.h" @@ -651,9 +652,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList() // Reverse iterate over the different dependency levels (deepest first). // Sort tests within each level by COST and append them to the cost list. - for (std::list<TestSet>::reverse_iterator i = priorityStack.rbegin(); - i != priorityStack.rend(); ++i) { - TestSet const& currentSet = *i; + for (TestSet const& currentSet : cmReverseRange(priorityStack)) { TestComparator comp(this); TestList sortedCopy; diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 435be97..ac4753c 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestP4.h" +#include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestVC.h" #include "cmProcessTools.h" @@ -425,12 +426,11 @@ bool cmCTestP4::LoadRevisions() // p4 describe -s ...@1111111,2222222 std::vector<char const*> p4_describe; - for (std::vector<std::string>::reverse_iterator i = ChangeLists.rbegin(); - i != ChangeLists.rend(); ++i) { + for (std::string const& i : cmReverseRange(ChangeLists)) { SetP4Options(p4_describe); p4_describe.push_back("describe"); p4_describe.push_back("-s"); - p4_describe.push_back(i->c_str()); + p4_describe.push_back(i.c_str()); p4_describe.push_back(nullptr); DescribeParser outDescribe(this, "p4_describe-out> "); |