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 /sfx2/source | |
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 'sfx2/source')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 1cede475db43..7765793c8a13 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1350,14 +1350,6 @@ void FileDialogHelper_Impl::implStartExecute() } } -static void lcl_saveLastURLs(std::vector<OUString>& rpURLList, - ::std::vector< OUString >& lLastURLs ) -{ - lLastURLs.clear(); - for (auto const& url : rpURLList) - lLastURLs.push_back(url); -} - void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterface >& xPicker, std::vector<OUString>& rpURLList) { rpURLList.clear(); @@ -1397,7 +1389,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac } } - lcl_saveLastURLs(rpURLList, mlLastURLs); + mlLastURLs = rpURLList; } ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList, |