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

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

Issue 2424793002: Revert of 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_data_util.cc
diff --git a/components/autofill/core/browser/autofill_data_util.cc b/components/autofill/core/browser/autofill_data_util.cc
index 5a09665034c0e000a219ac73bc38ceee386e3d8b..3d4c48d24635a6aefc6a53c91757b6bd9543fb01 100644
--- a/components/autofill/core/browser/autofill_data_util.cc
+++ b/components/autofill/core/browser/autofill_data_util.cc
@@ -400,18 +400,19 @@
}
const PaymentRequestData& GetPaymentRequestData(const std::string& type) {
- for (const PaymentRequestData& data : kPaymentRequestData) {
- if (type == data.card_type)
- return data;
+ for (size_t i = 0; i < arraysize(kPaymentRequestData); ++i) {
+ if (type == kPaymentRequestData[i].card_type)
+ return kPaymentRequestData[i];
}
return kGenericPaymentRequestData;
}
const char* GetCardTypeForBasicCardPaymentType(
const std::string& basic_card_payment_type) {
- for (const PaymentRequestData& data : kPaymentRequestData) {
- if (basic_card_payment_type == data.basic_card_payment_type) {
- return data.card_type;
+ for (size_t i = 0; i < arraysize(kPaymentRequestData); ++i) {
+ if (basic_card_payment_type ==
+ kPaymentRequestData[i].basic_card_payment_type) {
+ return kPaymentRequestData[i].card_type;
}
}
return kGenericPaymentRequestData.card_type;

Powered by Google App Engine
This is Rietveld 408576698