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 /framework | |
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 'framework')
-rw-r--r-- | framework/source/accelerators/acceleratorconfiguration.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index fb5525e295f9..877b4a9f6843 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -971,12 +971,8 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( bool bPreferred, const css: xAccess->getByName(sKey) >>= xKey; xKey->getByName(CFG_PROP_COMMAND) >>= xCommand; - css::uno::Sequence< OUString > lLocales = xCommand->getElementNames(); - sal_Int32 nLocales = lLocales.getLength(); - ::std::vector< OUString > aLocales; - aLocales.reserve(nLocales); - for (sal_Int32 j = 0; j < nLocales; ++j) - aLocales.push_back(lLocales[j]); + const css::uno::Sequence< OUString > lLocales = xCommand->getElementNames(); + ::std::vector< OUString > aLocales { lLocales.begin(), lLocales.end() }; OUString sLocale; for (auto const& locale : aLocales) |