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

Unified Diff: components/autofill/core/browser/credit_card.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/credit_card.cc
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index 27700bed98a4589728ba09e5e8371fec137d7a08..75a34c75a26041143962be118c277e481d00ca4b 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -574,9 +574,8 @@
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 (ServerFieldType type : types) {
+ int comparison = GetRawInfo(type).compare(credit_card.GetRawInfo(type));
if (comparison != 0)
return comparison;
}
« no previous file with comments | « components/autofill/core/browser/contact_info_unittest.cc ('k') | components/autofill/core/browser/credit_card_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698