summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/BC_UtilCodingConvert.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-08 09:00:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-08 09:00:35 -0700
commit8b36e5cc3d5f5f579c6b060e2c40b896a4b02bc0 (patch)
treef84a20d330d92b791d0322f424cb155816d77d1b /xfa/fxbarcode/BC_UtilCodingConvert.cpp
parent8da140e8747920057a2f2bbcf5c78e40bb198733 (diff)
downloadpdfium-8b36e5cc3d5f5f579c6b060e2c40b896a4b02bc0.tar.xz
Make CFX_WideString::FromLocal() take a CFX_ByteStringC arg
It doesn't persist the string beyond the duration of the call, hence it should take the *StringC variant. Doing so avoids some allocs by changing to the *StringC ctor in a few places, at the cost of some explicit .ToByteStringC() calls (which are cheap). Review URL: https://codereview.chromium.org/1862953004
Diffstat (limited to 'xfa/fxbarcode/BC_UtilCodingConvert.cpp')
-rw-r--r--xfa/fxbarcode/BC_UtilCodingConvert.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xfa/fxbarcode/BC_UtilCodingConvert.cpp b/xfa/fxbarcode/BC_UtilCodingConvert.cpp
index 79311691e2..118e45e95d 100644
--- a/xfa/fxbarcode/BC_UtilCodingConvert.cpp
+++ b/xfa/fxbarcode/BC_UtilCodingConvert.cpp
@@ -17,13 +17,13 @@ void CBC_UtilCodingConvert::UnicodeToLocale(const CFX_WideString& src,
void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString& src,
CFX_ByteString& dst) {
- CFX_WideString unicode = CFX_WideString::FromLocal(src);
+ CFX_WideString unicode = CFX_WideString::FromLocal(src.AsByteStringC());
dst = unicode.UTF8Encode();
}
void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString& src,
CFX_ByteArray& dst) {
- CFX_WideString unicode = CFX_WideString::FromLocal(src);
+ CFX_WideString unicode = CFX_WideString::FromLocal(src.AsByteStringC());
CFX_ByteString utf8 = unicode.UTF8Encode();
for (int32_t i = 0; i < utf8.GetLength(); i++) {
dst.Add(utf8[i]);