1
0
Fork 0

Codechange: std::filesystem::rename does not need remove first.

pull/12484/head
Peter Nelson 2024-04-12 12:12:04 +01:00
parent bb9b8b90c7
commit 4f6b22719e
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 0 additions and 3 deletions

View File

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