diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-23 12:49:54 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-23 14:19:49 (GMT) |
commit | 006229278b54ee92003100773a0430565fb8fe87 (patch) | |
tree | 04a9927d32bf98df5685fde3b0e5be4811e67f8d /Source/CTest/cmCTestMultiProcessHandler.cxx | |
parent | 999516478d56d8604d1413fe3c677a860357516c (diff) | |
download | CMake-006229278b54ee92003100773a0430565fb8fe87.zip CMake-006229278b54ee92003100773a0430565fb8fe87.tar.gz CMake-006229278b54ee92003100773a0430565fb8fe87.tar.bz2 |
Use cmAppend to append ranges to std::vector instances
Diffstat (limited to 'Source/CTest/cmCTestMultiProcessHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 477161a..ef63073 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" @@ -653,13 +654,10 @@ 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 (TestSet const& currentSet : cmReverseRange(priorityStack)) { - TestComparator comp(this); - TestList sortedCopy; - - sortedCopy.insert(sortedCopy.end(), currentSet.begin(), currentSet.end()); - - std::stable_sort(sortedCopy.begin(), sortedCopy.end(), comp); + cmAppend(sortedCopy, currentSet); + std::stable_sort(sortedCopy.begin(), sortedCopy.end(), + TestComparator(this)); for (auto const& j : sortedCopy) { if (alreadySortedTests.find(j) == alreadySortedTests.end()) { @@ -688,8 +686,8 @@ void cmCTestMultiProcessHandler::CreateSerialTestCostList() presortedList.push_back(i.first); } - TestComparator comp(this); - std::stable_sort(presortedList.begin(), presortedList.end(), comp); + std::stable_sort(presortedList.begin(), presortedList.end(), + TestComparator(this)); TestSet alreadySortedTests; @@ -992,7 +990,7 @@ static Json::Value DumpCTestInfo( const std::vector<std::string>& args = testRun.GetArguments(); if (!args.empty()) { commandAndArgs.reserve(args.size() + 1); - commandAndArgs.insert(commandAndArgs.end(), args.begin(), args.end()); + cmAppend(commandAndArgs, args); } testInfo["command"] = DumpToJsonArray(commandAndArgs); } |