summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-02 19:50:49 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-17 23:41:41 (GMT)
commit7bca3f8c800510509be3468f57226daf5708e91c (patch)
tree30a5c9bcd95d2ea40044d3ad416cc7e410c620ba /Source
parentd6d114f3e8ad7333b9dcf18c9c583e778d334659 (diff)
downloadCMake-7bca3f8c800510509be3468f57226daf5708e91c.zip
CMake-7bca3f8c800510509be3468f57226daf5708e91c.tar.gz
CMake-7bca3f8c800510509be3468f57226daf5708e91c.tar.bz2
cmCTestMultiProcessHandler: Avoid extra copy of test maps
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx8
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx2
3 files changed, 6 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index c80bfff..f2c89f8 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -83,11 +83,11 @@ cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler() = default;
// Set the tests
-void cmCTestMultiProcessHandler::SetTests(TestMap& tests,
- PropertiesMap& properties)
+void cmCTestMultiProcessHandler::SetTests(TestMap tests,
+ PropertiesMap properties)
{
- this->Tests = tests;
- this->Properties = properties;
+ this->Tests = std::move(tests);
+ this->Properties = std::move(properties);
this->Total = this->Tests.size();
if (!this->CTest->GetShowOnly()) {
this->ReadCostData();
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 7b288cf..4bf0844 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -57,7 +57,7 @@ public:
cmCTestMultiProcessHandler();
virtual ~cmCTestMultiProcessHandler();
// Set the tests
- void SetTests(TestMap& tests, PropertiesMap& properties);
+ void SetTests(TestMap tests, PropertiesMap properties);
// Set the max number of tests that can be run at the same time.
void SetParallelLevel(size_t);
void SetTestLoad(unsigned long load);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index eb3b4dd..2fcef90 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1385,7 +1385,7 @@ bool cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
properties[p.Index] = &p;
}
parallel->SetResourceSpecFile(this->ResourceSpecFile);
- parallel->SetTests(tests, properties);
+ parallel->SetTests(std::move(tests), std::move(properties));
parallel->SetPassFailVectors(&passed, &failed);
this->TestResults.clear();
parallel->SetTestResults(&this->TestResults);