summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/dialog/langbox.cxx3
-rw-r--r--svx/source/svdraw/svdedxv.cxx1
-rw-r--r--svx/source/unodraw/unoshape.cxx3
3 files changed, 5 insertions, 2 deletions
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 28960c0a6731..fe93fbc3d349 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -78,7 +78,8 @@ static std::vector< LanguageType > lcl_LocaleSeqToLangSeq( Sequence< css::lang::
sal_Int32 nCount = rSeq.getLength();
std::vector< LanguageType > aLangs;
- for (sal_Int32 i = 0; i < nCount; ++i)
+ aLangs.reserve(nCount);
+ for (sal_Int32 i = 0; i < nCount; ++i)
{
aLangs.push_back( LanguageTag::convertToLanguageType( pLocale[i] ) );
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index bfe91b5268b8..bde1c7236b46 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -595,6 +595,7 @@ namespace
// get logic selection
getOutlinerView().GetSelectionRectangles(aLogicRects);
+ aLogicRanges.reserve(aLogicRects.size());
for (const auto& aRect : aLogicRects)
{
// convert from logic Rectangles to logic Ranges, do not forget to add
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index a61ce3fbc79d..6f68c8611241 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -3111,7 +3111,8 @@ uno::Sequence<uno::Any> SvxShape::getPropertyDefaults(
const uno::Sequence<OUString>& aPropertyNames )
{
::std::vector<uno::Any> ret;
- for ( sal_Int32 pos = 0; pos < aPropertyNames.getLength(); ++pos )
+ ret.reserve(aPropertyNames.getLength());
+ for (sal_Int32 pos = 0; pos < aPropertyNames.getLength(); ++pos)
ret.push_back( getPropertyDefault( aPropertyNames[pos] ) );
return uno::Sequence<uno::Any>( &ret[0], ret.size() );
}