mirror of
https://github.com/reactos/CMake.git
synced 2025-03-04 09:57:12 +00:00
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.
This commit is contained in:
parent
922482dd3a
commit
7c5ec91301
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user