[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sw/source

Michael Stahl mstahl at redhat.com
Sat May 14 20:25:08 UTC 2016


 sw/source/core/access/accmap.cxx |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 812233147c8b09b59eeb212663727a9063c7c9c6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu May 12 18:55:13 2016 +0200

    tdf#99722 sw: silly performance issue when firing a11y events
    
    SwAccessibleEventList_Impl::MoveInvalidXAccToEnd() pointlessly copies every
    single element when iterating over the list and then deletes the copy again
    (which is expensive due to the WeakReference member).
    
    This speeds up loading the first 500 pages of the bugdoc from 4:20 to
    1:37 in a Linux dbgutil build.
    
    (regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba)
    
    Change-Id: I7c7299e5e82095f5a51f395bc5076ca899b59f81
    (cherry picked from commit e3b990a47fc4b0b1191eb15a53badfc71aebc1fc)
    Reviewed-on: https://gerrit.libreoffice.org/24978
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 817bdfd..8f6c9da 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -526,17 +526,12 @@ void SwAccessibleEventList_Impl::MoveInvalidXAccToEnd()
         return;
     }
     SwAccessibleEventList_Impl lstEvent;
-    iterator li = begin();
-    for ( ;li != end();)
+    for (iterator li = begin(); li != end(); )
     {
-        SwAccessibleEvent_Impl e = *li;
-        if (e.IsNoXaccParentFrame())
+        if (li->IsNoXaccParentFrame())
         {
-            iterator liNext = li;
-            ++liNext;
-            erase(li);
-            li = liNext;
-            lstEvent.insert(lstEvent.end(),e);
+            lstEvent.insert(lstEvent.end(), *li);
+            li = erase(li);
         }
         else
             ++li;


More information about the Libreoffice-commits mailing list