summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-05-12 18:55:13 +0200
committerMichael Stahl <mstahl@redhat.com>2016-05-12 20:02:46 +0200
commite3b990a47fc4b0b1191eb15a53badfc71aebc1fc (patch)
tree0181ceec4211f690edd46280f35026b00699fb3c
parent532506b1f88388735cafd6544a140e3069cc6a73 (diff)
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
-rw-r--r--sw/source/core/access/accmap.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 7449a394c87b..1f0fec976995 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -527,17 +527,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;