From 003906becb03a2da582930f9b24d61c406221885 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 12:51:42 +0100 Subject: [PATCH] Codechange: std::filesystem::rename does not need remove first. (#12484) --- src/strgen/strgen.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 8acb4dfbe5..63f5c02b4d 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -274,9 +274,6 @@ struct HeaderFileWriter : HeaderWriter, FileWriter { std::filesystem::remove(this->path, error_code); // Just ignore the error } else { /* else rename tmp.xxx into filename */ -# if defined(_WIN32) - std::filesystem::remove(this->real_path, error_code); // Just ignore the error, file probably doesn't exist -# endif std::filesystem::rename(this->path, this->real_path, error_code); if (error_code) FatalError("rename({}, {}) failed: {}", this->path, this->real_path, error_code.message()); }