From e005dc33c31a2e701e1af3a0a3e5775cabbf1ddd Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 Jun 2018 17:33:32 +0000 Subject: Move fxcrt::{Byte,Wide}Strings with std::move(). 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 Reviewed-by: Tom Sepez Commit-Queue: Tom Sepez --- fxjs/cjs_publicmethods.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fxjs/cjs_publicmethods.cpp') diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp index 908611b0d6..4630445a35 100644 --- a/fxjs/cjs_publicmethods.cpp +++ b/fxjs/cjs_publicmethods.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "core/fpdfdoc/cpdf_interform.h" @@ -1192,13 +1193,12 @@ double CJS_PublicMethods::MakeInterDate(const WideString& strValue) { WideString sTemp; for (const auto& c : strValue) { if (c == L' ' || c == L':') { - wsArray.push_back(sTemp); - sTemp.clear(); + wsArray.push_back(std::move(sTemp)); continue; } sTemp += c; } - wsArray.push_back(sTemp); + wsArray.push_back(std::move(sTemp)); if (wsArray.size() != 8) return 0; @@ -1471,7 +1471,7 @@ CJS_Return CJS_PublicMethods::AFSpecial_KeystrokeEx( } iIndexMask++; } - wideChange = wChange; + wideChange = std::move(wChange); return CJS_Return(); } -- cgit v1.2.3