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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp

Issue 2131963002: Early return if we find selected shipping option from last. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments fixed Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
index 294efb8b5f8874240c440db7441eca8782220154..ebd37747826b9175c001eeb3fd8abb5e3a8d1584 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -337,9 +337,9 @@ String getSelectedShippingOption(const PaymentDetails& details)
if (!details.hasShippingOptions())
return result;
- for (size_t i = 0; i < details.shippingOptions().size(); ++i) {
+ for (int i = details.shippingOptions().size() - 1; i >= 0; --i) {
if (details.shippingOptions()[i].hasSelected() && details.shippingOptions()[i].selected()) {
- result = details.shippingOptions()[i].id();
+ return details.shippingOptions()[i].id();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698