summaryrefslogtreecommitdiff
path: root/fxbarcode/BC_UtilCodingConvert.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-17 15:38:19 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 17:17:36 +0000
commit3c3e271ea9fd19dd535a74b5546b27e3e82dcb81 (patch)
treee73049f2d18718da9ff8d42b46f31009c5e6e887 /fxbarcode/BC_UtilCodingConvert.cpp
parent94c5e25840046b7bf976d2d568e19ad63b656ade (diff)
downloadpdfium-3c3e271ea9fd19dd535a74b5546b27e3e82dcb81.tar.xz
Use Byte/WideString iterators
Change-Id: I85c8423c177fd7ecd5da90ef89419efc0f9cf44b Reviewed-on: https://pdfium-review.googlesource.com/4262 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxbarcode/BC_UtilCodingConvert.cpp')
-rw-r--r--fxbarcode/BC_UtilCodingConvert.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/fxbarcode/BC_UtilCodingConvert.cpp b/fxbarcode/BC_UtilCodingConvert.cpp
index f1dea885c3..f0f497a07b 100644
--- a/fxbarcode/BC_UtilCodingConvert.cpp
+++ b/fxbarcode/BC_UtilCodingConvert.cpp
@@ -25,9 +25,7 @@ void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString& src,
std::vector<uint8_t>& dst) {
CFX_WideString unicode = CFX_WideString::FromLocal(src.AsStringC());
CFX_ByteString utf8 = unicode.UTF8Encode();
- for (int32_t i = 0; i < utf8.GetLength(); i++) {
- dst.push_back(utf8[i]);
- }
+ dst = std::vector<uint8_t>(utf8.begin(), utf8.end());
}
void CBC_UtilCodingConvert::Utf8ToLocale(const std::vector<uint8_t>& src,