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

Unified Diff: tools/gn/generate_test_gn_data.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/generate_test_gn_data.cc
diff --git a/tools/gn/generate_test_gn_data.cc b/tools/gn/generate_test_gn_data.cc
index 05197f748d201f742db208151d5dd22883bdc785..11dbf3619bfd2d2a040deca7b0606ee174b26ae9 100644
--- a/tools/gn/generate_test_gn_data.cc
+++ b/tools/gn/generate_test_gn_data.cc
@@ -30,8 +30,8 @@ std::string FilePathToUTF8(const base::FilePath& path) {
base::FilePath RepoPathToPathName(const std::vector<int>& repo_path) {
base::FilePath ret;
- for (size_t i = 0; i < repo_path.size(); i++) {
- ret = ret.Append(UTF8ToFilePath(base::IntToString(repo_path[i])));
+ for (const auto& elem : repo_path) {
+ ret = ret.Append(UTF8ToFilePath(base::IntToString(elem)));
}
return ret;
}
@@ -58,9 +58,9 @@ std::string RepoPathToTargetName(const std::vector<int>& repo_path,
std::string RepoPathToFullTargetName(const std::vector<int>& repo_path,
int target_index) {
std::string ret;
- for (size_t i = 0; i < repo_path.size(); i++) {
+ for (const auto& elem : repo_path) {
ret.push_back('/');
- ret.append(base::IntToString(repo_path[i]));
+ ret.append(base::IntToString(elem));
}
ret += ":" + RepoPathToTargetName(repo_path, target_index);

Powered by Google App Engine
This is Rietveld 408576698