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 --- fpdfsdk/cpdfsdk_interform.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'fpdfsdk/cpdfsdk_interform.cpp') diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp index 1e247465c8..379a8b999d 100644 --- a/fpdfsdk/cpdfsdk_interform.cpp +++ b/fpdfsdk/cpdfsdk_interform.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "core/fpdfapi/page/cpdf_page.h" @@ -322,13 +323,11 @@ WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, WideString script = action.GetJavaScript(); if (!script.IsEmpty()) { WideString Value = sValue; - IJS_Runtime::ScopedEventContext pContext(pRuntime); pContext->OnField_Format(pFormField, Value, true); - Optional err = pContext->RunScript(script); if (!err) { - sValue = Value; + sValue = std::move(Value); bFormatted = true; } } -- cgit v1.2.3