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

Unified Diff: components/autofill/core/browser/state_names.cc

Issue 2478463002: Reland of place for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 years, 1 month 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: components/autofill/core/browser/state_names.cc
diff --git a/components/autofill/core/browser/state_names.cc b/components/autofill/core/browser/state_names.cc
index c53704136689a7d0b150fe36dbbe5cf7b439c17e..a62f925680ff6120c370787920940131ac96efc0 100644
--- a/components/autofill/core/browser/state_names.cc
+++ b/components/autofill/core/browser/state_names.cc
@@ -80,8 +80,7 @@
} // namespace
base::string16 GetAbbreviationForName(const base::string16& name) {
- for (size_t i = 0; i < arraysize(kStateData); ++i) {
- const StateData& state = kStateData[i];
+ for (const StateData& state : kStateData) {
if (base::LowerCaseEqualsASCII(name, state.name))
return base::ASCIIToUTF16(state.abbreviation);
}
@@ -89,8 +88,7 @@
}
base::string16 GetNameForAbbreviation(const base::string16& abbreviation) {
- for (size_t i = 0; i < arraysize(kStateData); ++i) {
- const StateData& state = kStateData[i];
+ for (const StateData& state : kStateData) {
if (base::LowerCaseEqualsASCII(abbreviation, state.abbreviation))
return base::ASCIIToUTF16(state.name);
}

Powered by Google App Engine
This is Rietveld 408576698