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/cfxjse_resolveprocessor.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/cfxjse_resolveprocessor.cpp')
-rw-r--r-- | fxjs/cfxjse_resolveprocessor.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/fxjs/cfxjse_resolveprocessor.cpp b/fxjs/cfxjse_resolveprocessor.cpp index 46163b55fc..0419b79053 100644 --- a/fxjs/cfxjse_resolveprocessor.cpp +++ b/fxjs/cfxjse_resolveprocessor.cpp @@ -179,7 +179,7 @@ bool CFXJSE_ResolveProcessor::ResolveNumberSign(CFXJSE_ResolveNodeData& rnd) { rndFind.m_dwStyles = rnd.m_dwStyles; rndFind.m_dwStyles |= XFA_RESOLVENODE_TagName; rndFind.m_dwStyles &= ~XFA_RESOLVENODE_Attributes; - rndFind.m_wsName = wsName; + rndFind.m_wsName = std::move(wsName); rndFind.m_uHashName = static_cast<XFA_HashCode>( FX_HashCode_GetW(rndFind.m_wsName.AsStringView(), false)); rndFind.m_wsCondition = wsCondition; @@ -255,10 +255,9 @@ bool CFXJSE_ResolveProcessor::ResolveNormal(CFXJSE_ResolveNodeData& rnd) { } else { rndFind.m_CurObject = pVariablesNode; SetStylesForChild(dwStyles, rndFind); - WideString wsSaveCondition = rndFind.m_wsCondition; - rndFind.m_wsCondition.clear(); + WideString wsSaveCondition = std::move(rndFind.m_wsCondition); ResolveNormal(rndFind); - rndFind.m_wsCondition = wsSaveCondition; + rndFind.m_wsCondition = std::move(wsSaveCondition); rnd.m_Objects.insert(rnd.m_Objects.end(), rndFind.m_Objects.begin(), rndFind.m_Objects.end()); rndFind.m_Objects.clear(); @@ -290,11 +289,9 @@ bool CFXJSE_ResolveProcessor::ResolveNormal(CFXJSE_ResolveNodeData& rnd) { } rndFind.m_CurObject = child; - WideString wsSaveCondition = rndFind.m_wsCondition; - rndFind.m_wsCondition.clear(); + WideString wsSaveCondition = std::move(rndFind.m_wsCondition); ResolveNormal(rndFind); - - rndFind.m_wsCondition = wsSaveCondition; + rndFind.m_wsCondition = std::move(wsSaveCondition); rnd.m_Objects.insert(rnd.m_Objects.end(), rndFind.m_Objects.begin(), rndFind.m_Objects.end()); rndFind.m_Objects.clear(); @@ -425,15 +422,12 @@ bool CFXJSE_ResolveProcessor::ResolveNormal(CFXJSE_ResolveNodeData& rnd) { } if (bInnerSearch) { rndFind.m_CurObject = child; - WideString wsOriginCondition = rndFind.m_wsCondition; - rndFind.m_wsCondition.clear(); - + WideString wsOriginCondition = std::move(rndFind.m_wsCondition); uint32_t dwOriginStyle = rndFind.m_dwStyles; rndFind.m_dwStyles = dwOriginStyle | XFA_RESOLVENODE_ALL; ResolveNormal(rndFind); - rndFind.m_dwStyles = dwOriginStyle; - rndFind.m_wsCondition = wsOriginCondition; + rndFind.m_wsCondition = std::move(wsOriginCondition); rnd.m_Objects.insert(rnd.m_Objects.end(), rndFind.m_Objects.begin(), rndFind.m_Objects.end()); rndFind.m_Objects.clear(); |