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

Unified Diff: tools/gn/ninja_target_writer.cc

Issue 1704383002: [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, 10 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
« no previous file with comments | « tools/gn/function_write_file.cc ('k') | tools/gn/visual_studio_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_target_writer.cc
diff --git a/tools/gn/ninja_target_writer.cc b/tools/gn/ninja_target_writer.cc
index 7d9c08afd65bdcb7741b52f8633ada63bfd56b79..9f19b2b0065321d12f74279d97dfbe492cf5ecc1 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.str(), nullptr);
}
void NinjaTargetWriter::WriteEscapedSubstitution(SubstitutionType type) {
« no previous file with comments | « tools/gn/function_write_file.cc ('k') | tools/gn/visual_studio_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698