summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-11 13:44:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-12 08:26:21 +0200
commitf7f527a0add582cde2f34d992b65ed6ec79633d4 (patch)
tree095f610d2c38ea978cb9346c0a8c6d6dc112a416 /editeng
parent109debb0ca0c864296ad7f557cfbc2b05c9ec3c2 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit3.cxx6
1 files changed, 4 insertions, 2 deletions
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<sal_Int32> aRepaintParas;
+ sal_Int32 nParaCount = GetParaPortions().Count();
+ o3tl::sorted_vector<sal_Int32> 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() ) )