diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-23 10:21:46 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-23 16:52:33 (GMT) |
commit | 3b2b02825d88a045d08b8295927652cbcff408a8 (patch) | |
tree | 576d53beef55b9da82fe7e22187efb023c12d59d /Source/cmake.cxx | |
parent | 19612dffd27d90d73e3b7cff9cbba241294c17e9 (diff) | |
download | CMake-3b2b02825d88a045d08b8295927652cbcff408a8.zip CMake-3b2b02825d88a045d08b8295927652cbcff408a8.tar.gz CMake-3b2b02825d88a045d08b8295927652cbcff408a8.tar.bz2 |
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/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a5c8d46..7124958 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2106,9 +2106,7 @@ int cmake::CheckBuildSystem() // If no file is provided for the check, we have to rerun. if (this->CheckBuildSystemArgument.empty()) { if (verbose) { - std::ostringstream msg; - msg << "Re-run cmake no build system arguments\n"; - cmSystemTools::Stdout(msg.str()); + cmSystemTools::Stdout("Re-run cmake no build system arguments\n"); } return 1; } @@ -2191,10 +2189,8 @@ int cmake::CheckBuildSystem() if (depends.empty() || outputs.empty()) { // Not enough information was provided to do the test. Just rerun. if (verbose) { - std::ostringstream msg; - msg << "Re-run cmake no CMAKE_MAKEFILE_DEPENDS " - "or CMAKE_MAKEFILE_OUTPUTS :\n"; - cmSystemTools::Stdout(msg.str()); + cmSystemTools::Stdout("Re-run cmake no CMAKE_MAKEFILE_DEPENDS " + "or CMAKE_MAKEFILE_OUTPUTS :\n"); } return 1; } @@ -2210,9 +2206,8 @@ int cmake::CheckBuildSystem() } } else { if (verbose) { - std::ostringstream msg; - msg << "Re-run cmake: build system dependency is missing\n"; - cmSystemTools::Stdout(msg.str()); + cmSystemTools::Stdout( + "Re-run cmake: build system dependency is missing\n"); } return 1; } @@ -2229,9 +2224,8 @@ int cmake::CheckBuildSystem() } } else { if (verbose) { - std::ostringstream msg; - msg << "Re-run cmake: build system output is missing\n"; - cmSystemTools::Stdout(msg.str()); + cmSystemTools::Stdout( + "Re-run cmake: build system output is missing\n"); } return 1; } |