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

Side by Side Diff: tools/gn/commands.cc

Issue 610293003: Replace more for loops in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « tools/gn/command_refs.cc ('k') | tools/gn/err.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/commands.h" 5 #include "tools/gn/commands.h"
6 #include "tools/gn/filesystem_utils.h" 6 #include "tools/gn/filesystem_utils.h"
7 #include "tools/gn/item.h" 7 #include "tools/gn/item.h"
8 #include "tools/gn/label.h" 8 #include "tools/gn/label.h"
9 #include "tools/gn/label_pattern.h" 9 #include "tools/gn/label_pattern.h"
10 #include "tools/gn/setup.h" 10 #include "tools/gn/setup.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // explicitly. 106 // explicitly.
107 if (pattern.toolchain().is_null()) { 107 if (pattern.toolchain().is_null()) {
108 // No explicit toolchain set. 108 // No explicit toolchain set.
109 pattern.set_toolchain(setup->loader()->default_toolchain_label()); 109 pattern.set_toolchain(setup->loader()->default_toolchain_label());
110 } 110 }
111 } 111 }
112 112
113 std::vector<const Target*> all_targets = 113 std::vector<const Target*> all_targets =
114 setup->builder()->GetAllResolvedTargets(); 114 setup->builder()->GetAllResolvedTargets();
115 115
116 for (size_t i = 0; i < all_targets.size(); i++) { 116 for (const auto& target : all_targets) {
117 if (pattern.Matches(all_targets[i]->label())) 117 if (pattern.Matches(target->label()))
118 matches->push_back(all_targets[i]); 118 matches->push_back(target);
119 } 119 }
120 return true; 120 return true;
121 } 121 }
122 122
123 } // namespace commands 123 } // namespace commands
OLDNEW
« no previous file with comments | « tools/gn/command_refs.cc ('k') | tools/gn/err.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698