editeng/source/editeng/impedit3.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit f7f527a0add582cde2f34d992b65ed6ec79633d4
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed May 11 13:44:28 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu May 12 08:26:21 2022 +0200

    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 <[email protected]>

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() ) )

Reply via email to