summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-04 18:03:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-05 09:28:27 +0200
commit80f990b8e3d05e47e041685a7811f1352d03ad4d (patch)
tree2b2c045c75544767499aea0d2b18e1890e9b9566 /framework
parentc2139cafe6240991f88b85c1df12613d0ae0e821 (diff)
clang-tidy performance-inefficient-vector-operation
Change-Id: Iebcaea7b08c5284946d83b6b6b9ed26b218025d4 Reviewed-on: https://gerrit.libreoffice.org/59992 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/accelerators/acceleratorconfiguration.cxx3
-rw-r--r--framework/source/fwi/classes/converter.cxx3
2 files changed, 4 insertions, 2 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index e5f5cc3b80b5..0d931fbc0f66 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -989,7 +989,8 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( bool bPreferred, const css:
css::uno::Sequence< OUString > lLocales = xCommand->getElementNames();
sal_Int32 nLocales = lLocales.getLength();
::std::vector< OUString > aLocales;
- for ( sal_Int32 j=0; j<nLocales; ++j )
+ aLocales.reserve(nLocales);
+ for (sal_Int32 j = 0; j < nLocales; ++j)
aLocales.push_back(lLocales[j]);
OUString sLocale;
diff --git a/framework/source/fwi/classes/converter.cxx b/framework/source/fwi/classes/converter.cxx
index b25f35e797c6..33af820202c9 100644
--- a/framework/source/fwi/classes/converter.cxx
+++ b/framework/source/fwi/classes/converter.cxx
@@ -45,7 +45,8 @@ std::vector<OUString> Converter::convert_seqOUString2OUStringList( const css::un
std::vector<OUString> lDestination;
sal_Int32 nCount = lSource.getLength();
- for (sal_Int32 nItem=0; nItem<nCount; ++nItem )
+ lDestination.reserve(nCount);
+ for (sal_Int32 nItem = 0; nItem < nCount; ++nItem)
{
lDestination.push_back(lSource[nItem]);
}