[include-cleaner] No need to overwrite the source file if there is no

cleanups
This commit is contained in:
Haojian Wu 2023-06-22 14:35:28 +02:00
parent cd116e0460
commit e339b07944

View File

@ -148,7 +148,7 @@ class Action : public clang::ASTFrontendAction {
}
}
if (Edit) {
if (Edit && (!Results.Missing.empty() || !Results.Unused.empty())) {
if (auto Err = llvm::writeToOutput(
Path, [&](llvm::raw_ostream &OS) -> llvm::Error {
OS << Final;