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(); |
} |
} |