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

Unified Diff: tools/gn/builder.cc

Issue 610043002: Convert GN's deps iterator to work with range-based for loops. (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
Index: tools/gn/builder.cc
diff --git a/tools/gn/builder.cc b/tools/gn/builder.cc
index 6198777b65977f353c538368a4e997a47dbdf403..e92a7e01f0823ef20213dffeb0c1b24bdda56041 100644
--- a/tools/gn/builder.cc
+++ b/tools/gn/builder.cc
@@ -481,14 +481,13 @@ bool Builder::ResolveForwardDependentConfigs(Target* target, Err* err) {
// Assume that the lists are small so that brute-force n^2 is appropriate.
for (size_t config_i = 0; config_i < configs.size(); config_i++) {
- for (DepsIterator dep_iter(target, DepsIterator::LINKED_ONLY);
- !dep_iter.done(); dep_iter.Advance()) {
- if (configs[config_i].label == dep_iter.label()) {
- DCHECK(dep_iter.target()); // Should already be resolved.
+ for (const auto& dep_pair : target->GetDeps(Target::DEPS_LINKED)) {
+ if (configs[config_i].label == dep_pair.label) {
+ DCHECK(dep_pair.ptr); // Should already be resolved.
// UniqueVector's contents are constant so uniqueness is preserved, but
// we want to update this pointer which doesn't change uniqueness
// (uniqueness in this vector is determined by the label only).
- const_cast<LabelTargetPair&>(configs[config_i]).ptr = dep_iter.target();
+ const_cast<LabelTargetPair&>(configs[config_i]).ptr = dep_pair.ptr;
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698