From f7f527a0add582cde2f34d992b65ed6ec79633d4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 11 May 2022 13:44:28 +0200 Subject: tdf#121740 std::set->o3tl::sorted_vector in ImpEditEngine::FormatDoc we're almost always adding to the end, and we can size the vector up-front, a perfect application for sorted_vector Shaves 2% off load time. Change-Id: I708ff1451b91635b54eaea0355a03a84bd775754 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134203 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/editeng/impedit3.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'editeng/source') diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 34caef587297..ff4356c8aa75 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -376,9 +376,11 @@ void ImpEditEngine::FormatDoc() // Here already, so that not always in CreateLines... bool bMapChanged = ImpCheckRefMapMode(); - std::set aRepaintParas; + sal_Int32 nParaCount = GetParaPortions().Count(); + o3tl::sorted_vector aRepaintParas; + aRepaintParas.reserve(nParaCount); - for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ ) + for ( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ ) { ParaPortion* pParaPortion = GetParaPortions()[nPara]; if ( pParaPortion->MustRepaint() || ( pParaPortion->IsInvalid() && pParaPortion->IsVisible() ) ) -- cgit ='distro/cib/libreoffice-5-4'>distro/cib/libreoffice-5-4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2024-05-14loplugin:ostr in vbahelperNoel Grandin