diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-19 17:33:32 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-19 17:33:32 +0000 |
commit | e005dc33c31a2e701e1af3a0a3e5775cabbf1ddd (patch) | |
tree | 6cf7623219078464910ee438311e24121c8af2a0 /fxjs/cjs_publicmethods.cpp | |
parent | ed1c58049f0c164969946b6ad0ff06d952ab1949 (diff) | |
download | pdfium-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 'fxjs/cjs_publicmethods.cpp')
-rw-r--r-- | fxjs/cjs_publicmethods.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 <limits> #include <sstream> #include <string> +#include <utility> #include <vector> #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(); } |