diff options
author | Brad King <brad.king@kitware.com> | 2018-01-29 13:05:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-29 13:05:27 (GMT) |
commit | 92cd3d06772ada13935790d66927ab4663c7d628 (patch) | |
tree | 2550a2ad9003b47f9029c186aeabdfd6521bc615 /Source/CTest/cmCTestMemCheckHandler.cxx | |
parent | 18153217e27d2cf560d874313557ec9fa2bcffdb (diff) | |
parent | c85bb007df37aad9f20355cdf4d7ca9af562cb20 (diff) | |
download | CMake-92cd3d06772ada13935790d66927ab4663c7d628.zip CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.gz CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.bz2 |
Merge topic 'reduce-temporaries'
c85bb007 Reduce allocation of temporary values on heap.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1698
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index c3fbc0d..84151e8 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -15,6 +15,7 @@ #include <iostream> #include <sstream> #include <string.h> +#include <utility> struct CatToErrorType { @@ -546,12 +547,12 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() << std::endl); return false; } - std::string suppressions = "--suppressions=" + - this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile"); - this->MemoryTesterOptions.push_back(suppressions); + this->MemoryTesterOptions.push_back( + "--suppressions=" + + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile")); } - std::string outputFile = "--log-file=" + this->MemoryTesterOutputFile; - this->MemoryTesterDynamicOptions.push_back(outputFile); + this->MemoryTesterDynamicOptions.push_back("--log-file=" + + this->MemoryTesterOutputFile); break; } case cmCTestMemCheckHandler::PURIFY: { @@ -589,7 +590,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() "/Testing/Temporary/MemoryChecker.??.DPbd"; this->BoundsCheckerDPBDFile = dpbdFile; this->MemoryTesterDynamicOptions.push_back("/B"); - this->MemoryTesterDynamicOptions.push_back(dpbdFile); + this->MemoryTesterDynamicOptions.push_back(std::move(dpbdFile)); this->MemoryTesterDynamicOptions.push_back("/X"); this->MemoryTesterDynamicOptions.push_back(this->MemoryTesterOutputFile); this->MemoryTesterOptions.push_back("/M"); @@ -1097,5 +1098,5 @@ void cmCTestMemCheckHandler::TestOutputFileNames( cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); ofile.clear(); } - files.push_back(ofile); + files.push_back(std::move(ofile)); } |