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

Unified Diff: tools/gn/input_file_manager.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, 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 | « tools/gn/input_conversion.cc ('k') | tools/gn/loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/input_file_manager.cc
diff --git a/tools/gn/input_file_manager.cc b/tools/gn/input_file_manager.cc
index f358fdc2e68420b19f9e65b6c34ab6f38560953e..0b6159c92a507e601800fa472f1db88ae76ad6b9 100644
--- a/tools/gn/input_file_manager.cc
+++ b/tools/gn/input_file_manager.cc
@@ -255,10 +255,9 @@ void InputFileManager::GetAllPhysicalInputFileNames(
std::vector<base::FilePath>* result) const {
base::AutoLock lock(lock_);
result->reserve(input_files_.size());
- for (InputFileMap::const_iterator i = input_files_.begin();
- i != input_files_.end(); ++i) {
- if (!i->second->file.physical_name().empty())
- result->push_back(i->second->file.physical_name());
+ for (const auto& file : input_files_) {
+ if (!file.second->file.physical_name().empty())
+ result->push_back(file.second->file.physical_name());
}
}
@@ -320,8 +319,8 @@ bool InputFileManager::LoadFile(const LocationRange& origin,
// separately to get some parallelism. But normally there will only be one
// item in the list, so that's extra overhead and complexity for no gain.
if (success) {
- for (size_t i = 0; i < callbacks.size(); i++)
- callbacks[i].Run(unowned_root);
+ for (const auto& cb : callbacks)
+ cb.Run(unowned_root);
}
return success;
}
« no previous file with comments | « tools/gn/input_conversion.cc ('k') | tools/gn/loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698