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

Unified Diff: components/autofill/core/browser/credit_card.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/credit_card.cc
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index 27700bed98a4589728ba09e5e8371fec137d7a08..7fee52b1686f3ec0c16f6d12b71efb19455df686 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -574,9 +574,8 @@ int CreditCard::Compare(const CreditCard& credit_card) const {
const ServerFieldType types[] = {CREDIT_CARD_NAME_FULL, CREDIT_CARD_NUMBER,
CREDIT_CARD_EXP_MONTH,
CREDIT_CARD_EXP_4_DIGIT_YEAR};
- for (size_t i = 0; i < arraysize(types); ++i) {
- int comparison =
- GetRawInfo(types[i]).compare(credit_card.GetRawInfo(types[i]));
+ for (const auto& type : types) {
vabr (Chromium) 2016/10/17 07:40:33 const auto& -> ServerFieldType
jdoerrie 2016/10/17 08:42:27 Done.
+ int comparison = GetRawInfo(type).compare(credit_card.GetRawInfo(type));
if (comparison != 0)
return comparison;
}

Powered by Google App Engine
This is Rietveld 408576698