summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestHandlerCommand.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-08-23 12:21:46 +0200
committerSebastian Holtermann <sebholt@xwmw.org>2019-08-23 18:52:33 +0200
commit3b2b02825d88a045d08b8295927652cbcff408a8 (patch)
tree576d53beef55b9da82fe7e22187efb023c12d59d /Source/CTest/cmCTestHandlerCommand.cxx
parent19612dffd27d90d73e3b7cff9cbba241294c17e9 (diff)
downloadcmake-3b2b02825d88a045d08b8295927652cbcff408a8.tar.gz
Source sweep: Replace std::ostringstream when used with a single append
This replaces `std::ostringstream`, when it is written to only once. If the single written argument was numeric, `std::to_string` is used instead. Otherwise, the single written argument is used directly instead of the `std::ostringstream::str()` invocation.
Diffstat (limited to 'Source/CTest/cmCTestHandlerCommand.cxx')
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 8ceca08c0a..6add71786c 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -228,9 +228,8 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
int res = handler->ProcessHandler();
if (this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) {
- std::ostringstream str;
- str << res;
- this->Makefile->AddDefinition(this->Values[ct_RETURN_VALUE], str.str());
+ this->Makefile->AddDefinition(this->Values[ct_RETURN_VALUE],
+ std::to_string(res));
}
this->ProcessAdditionalValues(handler);
// log the error message if there was an error