diff options
author | Brad King <brad.king@kitware.com> | 2019-09-09 17:50:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-09 17:51:23 (GMT) |
commit | 7c5ec91301f31e7caff6524ab83b5bb5c614d5d7 (patch) | |
tree | 2f64de684667c45efcaf2271b5c0a5b65ab6cf93 /Source | |
parent | 922482dd3acd2af9d26476134b3386c5a7695a03 (diff) | |
download | CMake-7c5ec91301f31e7caff6524ab83b5bb5c614d5d7.zip CMake-7c5ec91301f31e7caff6524ab83b5bb5c614d5d7.tar.gz CMake-7c5ec91301f31e7caff6524ab83b5bb5c614d5d7.tar.bz2 |
cmGeneratedFileStreamBase: Optimize string construction in Close
Use cmStrCat to concatenate two parts of a file name.
This also avoids a bugprone-exception-escape diagnostic from
clang-tidy-8 on macOS.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratedFileStream.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 7475e9f..491d96f 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -4,6 +4,7 @@ #include <stdio.h> +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #if !defined(CMAKE_BOOTSTRAP) @@ -149,7 +150,7 @@ bool cmGeneratedFileStreamBase::Close() // The destination is to be replaced. Rename the temporary to the // destination atomically. if (this->Compress) { - std::string gzname = this->TempName + ".temp.gz"; + std::string gzname = cmStrCat(this->TempName, ".temp.gz"); if (this->CompressFile(this->TempName, gzname)) { this->RenameFile(gzname, resname); } |