From 96d329455501dd9f7b38c6f4c5d54c7e13247dd1 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 29 Aug 2021 09:14:47 -0700 Subject: [PATCH] [Support] Remove redundant calls to str() and c_str() (NFC) Identified with readability-redundant-string-cstr. --- llvm/lib/Support/FileUtilities.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Support/FileUtilities.cpp b/llvm/lib/Support/FileUtilities.cpp index e4a86bb..dbe28e5 100644 --- a/llvm/lib/Support/FileUtilities.cpp +++ b/llvm/lib/Support/FileUtilities.cpp @@ -300,8 +300,7 @@ llvm::Error llvm::writeFileAtomically( std::function Writer) { SmallString<128> GeneratedUniqPath; int TempFD; - if (sys::fs::createUniqueFile(TempPathModel.str(), TempFD, - GeneratedUniqPath)) { + if (sys::fs::createUniqueFile(TempPathModel, TempFD, GeneratedUniqPath)) { return llvm::make_error( atomic_write_error::failed_to_create_uniq_file); } @@ -319,8 +318,7 @@ llvm::Error llvm::writeFileAtomically( atomic_write_error::output_stream_error); } - if (sys::fs::rename(/*from=*/GeneratedUniqPath.c_str(), - /*to=*/FinalPath.str().c_str())) { + if (sys::fs::rename(/*from=*/GeneratedUniqPath, /*to=*/FinalPath)) { return llvm::make_error( atomic_write_error::failed_to_rename_temp_file); } -- 2.7.4