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

Unified Diff: tools/gn/ninja_writer.cc

Issue 986113002: tools/gn: Convert for loops to use the new range-based loops in C++11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 5 years, 9 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_writer.cc
diff --git a/tools/gn/ninja_writer.cc b/tools/gn/ninja_writer.cc
index 37c982f688e88a42acc899f6807bfed3f7fa1dd8..23b9a72f8f913ff08f1b2ca1b10e430711106795 100644
--- a/tools/gn/ninja_writer.cc
+++ b/tools/gn/ninja_writer.cc
@@ -52,11 +52,11 @@ bool NinjaWriter::WriteToolchains(std::vector<const Settings*>* all_settings,
CategorizedMap categorized;
std::vector<const BuilderRecord*> all_records = builder_->GetAllRecords();
- for (size_t i = 0; i < all_records.size(); i++) {
- if (all_records[i]->type() == BuilderRecord::ITEM_TARGET &&
- all_records[i]->should_generate()) {
- categorized[all_records[i]->label().GetToolchainLabel()].push_back(
- all_records[i]->item()->AsTarget());
+ for (const auto& all_record : all_records) {
+ if (all_record->type() == BuilderRecord::ITEM_TARGET &&
+ all_record->should_generate()) {
+ categorized[all_record->label().GetToolchainLabel()].push_back(
+ all_record->item()->AsTarget());
}
}
if (categorized.empty()) {

Powered by Google App Engine
This is Rietveld 408576698