summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.cxx
diff options
context:
space:
mode:
authorArtur Ryt <artur.ryt@gmail.com>2019-03-30 15:11:21 (GMT)
committerArtur Ryt <artur.ryt@gmail.com>2019-03-30 15:15:05 (GMT)
commit2d66567dca2a5a80e41493ec0a9d6d86f7d955f5 (patch)
tree84468e248f456f65c75a99033ba8073e48ea0f5b /Source/CTest/cmCTestTestHandler.cxx
parent5bdee3786359b6560eb9ee1d6fab8664feb90db4 (diff)
downloadCMake-2d66567dca2a5a80e41493ec0a9d6d86f7d955f5.zip
CMake-2d66567dca2a5a80e41493ec0a9d6d86f7d955f5.tar.gz
CMake-2d66567dca2a5a80e41493ec0a9d6d86f7d955f5.tar.bz2
Modernize: Prefer .substr in place of .c_str() + int
A lot of temporary/local strings were created out of C-strings substr can utilize current string size, so in theory be a little more efficient.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index c9783e4..0ed56c8 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2265,8 +2265,8 @@ bool cmCTestTestHandler::SetTestsProperties(
size_t pos = val.find_first_of('=');
if (pos != std::string::npos) {
std::string mKey = val.substr(0, pos);
- const char* mVal = val.c_str() + pos + 1;
- rt.Measurements[mKey] = mVal;
+ std::string mVal = val.substr(pos + 1);
+ rt.Measurements[mKey] = std::move(mVal);
} else {
rt.Measurements[val] = "1";
}