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

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

Issue 2143483002: Use the single char overload of append() when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: third_party/WebKit/Source/modules/payments/PaymentAddress.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp b/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp
index 10fc77910557bff1aa91ba5c75f2b07d0379a163..fea61124fe053db5ece1068b381675bf26e49f04 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp
@@ -4,6 +4,8 @@
#include "modules/payments/PaymentAddress.h"
+#include "wtf/text/StringBuilder.h"
+
namespace blink {
PaymentAddress::PaymentAddress(mojom::blink::PaymentAddressPtr address)
@@ -21,8 +23,11 @@ PaymentAddress::PaymentAddress(mojom::blink::PaymentAddressPtr address)
, m_phone(address->phone)
{
if (!m_languageCode.isEmpty() && !address->script_code.isEmpty()) {
- m_languageCode.append("-");
- m_languageCode.append(address->script_code);
+ StringBuilder builder;
+ builder.append(m_languageCode);
+ builder.append('-');
+ builder.append(address->script_code);
+ m_languageCode = builder.toString();
}
}

Powered by Google App Engine
This is Rietveld 408576698