Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: tools/gn/ninja_target_writer.cc

Issue 1656253003: [GN] Don't rewrite files with the same contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/gn/ninja_target_writer.cc
diff --git a/tools/gn/ninja_target_writer.cc b/tools/gn/ninja_target_writer.cc
index 6c5d12b05c020e52bc9f6aaa587363dae4165d82..88001849a2d72376349d5cc57c92f304f7ed757a 100644
--- a/tools/gn/ninja_target_writer.cc
+++ b/tools/gn/ninja_target_writer.cc
@@ -74,9 +74,7 @@ void NinjaTargetWriter::RunAndWriteFile(const Target* target) {
CHECK(0) << "Output type of target not handled.";
}
- std::string contents = file.str();
- base::WriteFile(ninja_file, contents.c_str(),
- static_cast<int>(contents.size()));
+ WriteFileIfChanged(ninja_file, &file);
}
void NinjaTargetWriter::WriteEscapedSubstitution(SubstitutionType type) {

Powered by Google App Engine
This is Rietveld 408576698