From 80f990b8e3d05e47e041685a7811f1352d03ad4d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 4 Sep 2018 18:03:28 +0200 Subject: clang-tidy performance-inefficient-vector-operation Change-Id: Iebcaea7b08c5284946d83b6b6b9ed26b218025d4 Reviewed-on: https://gerrit.libreoffice.org/59992 Tested-by: Jenkins Reviewed-by: Noel Grandin --- linguistic/source/misc.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linguistic') diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index e21de4970bec..1bf297d4589e 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -384,7 +384,8 @@ std::vector< LanguageType > sal_Int32 nCount = rLocaleSeq.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( LinguLocaleToLanguage( pLocale[i] ) ); } -- cgit