mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
cmGeneratedFileStream: clang-tidy applied to remove redundant `c_str` calls
After changing the ``cmGeneratedFileStream`` methods to accept ``std::string const&`` instead of ``const char*`` we don't need to call ``std::string::c_str`` anymore when passing a ``std::string`` to a ``cmGeneratedFileStream`` method. This patch removes all redundant ``std::string::c_str`` calls when passing a string to a ``cmGeneratedFileStream`` method. It was generated by building CMake with clang-tidy enabled using the following options: -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
This commit is contained in:
@@ -168,12 +168,12 @@ bool cmGeneratedFileStreamBase::Close()
|
||||
// destination atomically.
|
||||
if (this->Compress) {
|
||||
std::string gzname = this->TempName + ".temp.gz";
|
||||
if (this->CompressFile(this->TempName.c_str(), gzname.c_str())) {
|
||||
this->RenameFile(gzname.c_str(), resname.c_str());
|
||||
if (this->CompressFile(this->TempName, gzname)) {
|
||||
this->RenameFile(gzname, resname);
|
||||
}
|
||||
cmSystemTools::RemoveFile(gzname);
|
||||
} else {
|
||||
this->RenameFile(this->TempName.c_str(), resname.c_str());
|
||||
this->RenameFile(this->TempName, resname);
|
||||
}
|
||||
|
||||
replaced = true;
|
||||
|
||||
Reference in New Issue
Block a user