diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-14 14:57:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-14 21:28:40 +0200 |
commit | 1f9468fc29874eae5100317282ab8b395904406d (patch) | |
tree | 7da605653b3a979d18c2283f42ac8a3efd9eae63 /svx | |
parent | 43b0d4f709a3a1446a32e36abb5deaa3bb45ddd9 (diff) |
use std::vector::insert instead of push_back
because it will pre-allocate space and often is optimised to memcpy
Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 10 | ||||
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 5 |
2 files changed, 4 insertions, 11 deletions
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index fb8252d76eba..9e499493acc7 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -253,18 +253,14 @@ void SvxIMapDlg::UpdateLink( const Graphic& rGraphic, const ImageMap* pImageMap, // Delete UpdateTargetList, because this method can still be called several // times before the update timer is turned on - pOwnData->aUpdateTargetList.clear(); // TargetList must be copied, since it is owned by the caller and can be // deleted immediately after this call the copied list will be deleted // again in the handler if( pTargetList ) - { - TargetList aTargetList( *pTargetList ); - - for (const OUString & s : aTargetList) - pOwnData->aUpdateTargetList.push_back( s ); - } + pOwnData->aUpdateTargetList = *pTargetList; + else + pOwnData->aUpdateTargetList.clear(); pOwnData->aIdle.Start(); } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index a4ed0e6090a9..d6f212f0c8e0 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -164,11 +164,8 @@ const ImageMap& IMapWindow::GetImageMap() void IMapWindow::SetTargetList( const TargetList& rTargetList ) { // Delete old List - aTargetList.clear(); - // Fill with the provided list - for(const OUString & s : rTargetList) - aTargetList.push_back( s ); + aTargetList = rTargetList; pModel->SetChanged( false ); } |