summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/cfgas_formatstring.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-19 17:33:32 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-19 17:33:32 +0000
commite005dc33c31a2e701e1af3a0a3e5775cabbf1ddd (patch)
tree6cf7623219078464910ee438311e24121c8af2a0 /xfa/fgas/crt/cfgas_formatstring.cpp
parented1c58049f0c164969946b6ad0ff06d952ab1949 (diff)
downloadpdfium-e005dc33c31a2e701e1af3a0a3e5775cabbf1ddd.tar.xz
Move fxcrt::{Byte,Wide}Strings with std::move().chromium/3466
Remove some string copies in barcode that were noticed whilst looking for moves. Change-Id: Ieda34d00f633576ba1f0dca283dcdabfb36f236c Reviewed-on: https://pdfium-review.googlesource.com/35410 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fgas/crt/cfgas_formatstring.cpp')
-rw-r--r--xfa/fgas/crt/cfgas_formatstring.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fgas/crt/cfgas_formatstring.cpp b/xfa/fgas/crt/cfgas_formatstring.cpp
index 0162100949..e9d065d124 100644
--- a/xfa/fgas/crt/cfgas_formatstring.cpp
+++ b/xfa/fgas/crt/cfgas_formatstring.cpp
@@ -7,6 +7,7 @@
#include "xfa/fgas/crt/cfgas_formatstring.h"
#include <algorithm>
+#include <utility>
#include <vector>
#include "core/fxcrt/cfx_decimal.h"
@@ -1647,11 +1648,11 @@ FX_DATETIMETYPE CFGAS_FormatString::GetDateTimeFormat(
bBraceOpen = false;
if (!wsTempPattern.IsEmpty()) {
if (eCategory == FX_LOCALECATEGORY_Time)
- *wsTimePattern = wsTempPattern;
+ *wsTimePattern = std::move(wsTempPattern);
else if (eCategory == FX_LOCALECATEGORY_Date)
- *wsDatePattern = wsTempPattern;
-
- wsTempPattern.clear();
+ *wsDatePattern = std::move(wsTempPattern);
+ else
+ wsTempPattern.clear();
}
} else {
wsTempPattern += pStr[ccf];
@@ -2246,14 +2247,13 @@ bool CFGAS_FormatString::FormatDateTime(const WideString& wsSrcDateTime,
return false;
if (eCategory == FX_DATETIMETYPE_Unknown) {
- if (eDateTimeType == FX_DATETIMETYPE_Time) {
- wsTimePattern = wsDatePattern;
- wsDatePattern.clear();
- }
+ if (eDateTimeType == FX_DATETIMETYPE_Time)
+ wsTimePattern = std::move(wsDatePattern);
+
eCategory = eDateTimeType;
+ if (eCategory == FX_DATETIMETYPE_Unknown)
+ return false;
}
- if (eCategory == FX_DATETIMETYPE_Unknown)
- return false;
CFX_DateTime dt;
auto iT = wsSrcDateTime.Find(L"T");