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

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

Issue 2417783004: Replace for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_profile.cc
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index 602cf1bf7bb2e320f732ade1783149cd70ace8c7..4668539f174378de508208a1d46b52eb00c087cb 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -354,8 +354,8 @@ int AutofillProfile::Compare(const AutofillProfile& profile) const {
PHONE_HOME_WHOLE_NUMBER,
};
- for (size_t i = 0; i < arraysize(types); ++i) {
- int comparison = GetRawInfo(types[i]).compare(profile.GetRawInfo(types[i]));
+ for (const auto& type : types) {
vabr (Chromium) 2016/10/17 07:40:33 const auto& -> ServerFieldType (1) Replacing auto
jdoerrie 2016/10/17 08:42:27 Done.
+ int comparison = GetRawInfo(type).compare(profile.GetRawInfo(type));
if (comparison != 0) {
return comparison;
}

Powered by Google App Engine
This is Rietveld 408576698