Codechange: std::filesystem::rename does not need remove first. (#12484)

master
Peter Nelson 2 months ago committed by GitHub
parent bb9b8b90c7
commit 003906becb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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());
}

Loading…
Cancel
Save