From 7c5ec91301f31e7caff6524ab83b5bb5c614d5d7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 9 Sep 2019 13:50:12 -0400 Subject: 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. --- Source/cmGeneratedFileStream.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +#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); } -- cgit v0.12