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

Unified Diff: tools/gn/builder.cc

Issue 557103003: Reverse the order of GN's cycle printing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/builder.cc
diff --git a/tools/gn/builder.cc b/tools/gn/builder.cc
index 65c5f601e967366b74d1a39d38830a25d7781b8b..87b0ac01801e2c162c6648369e62c7e562419118 100644
--- a/tools/gn/builder.cc
+++ b/tools/gn/builder.cc
@@ -208,7 +208,7 @@ bool Builder::CheckForBadItems(Err* err) const {
if (depstring.empty()) {
// Something's very wrong, just dump out the bad nodes.
depstring = "I have no idea what went wrong, but these are unresolved, "
- "possible due to an\ninternal error:";
+ "possibly due to an\ninternal error:";
for (size_t i = 0; i < bad_records.size(); i++) {
depstring += "\n\"" +
bad_records[i]->label().GetUserVisibleName(false) + "\"";
@@ -526,12 +526,12 @@ std::string Builder::CheckForCircularDependencies(
if (!RecursiveFindCycle(bad_records[0], &cycle))
return std::string(); // Didn't find a cycle, something else is wrong.
- // Walk backwards since the dependency arrows point in the reverse direction.
std::string ret;
- for (int i = static_cast<int>(cycle.size()) - 1; i >= 0; i--) {
+ for (size_t i = 0; i < cycle.size(); i++) {
ret += " " + cycle[i]->label().GetUserVisibleName(false);
- if (i != 0)
- ret += " ->\n";
+ if (i != cycle.size() - 1)
+ ret += " ->";
+ ret += "\n";
}
return ret;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698