Kaydet (Commit) e3b990a4 authored tarafından Michael Stahl's avatar Michael Stahl

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 76c549eb)

Change-Id: I7c7299e5e82095f5a51f395bc5076ca899b59f81
üst 532506b1
...@@ -527,17 +527,12 @@ void SwAccessibleEventList_Impl::MoveInvalidXAccToEnd() ...@@ -527,17 +527,12 @@ void SwAccessibleEventList_Impl::MoveInvalidXAccToEnd()
return; return;
} }
SwAccessibleEventList_Impl lstEvent; SwAccessibleEventList_Impl lstEvent;
iterator li = begin(); for (iterator li = begin(); li != end(); )
for ( ;li != end();)
{ {
SwAccessibleEvent_Impl e = *li; if (li->IsNoXaccParentFrame())
if (e.IsNoXaccParentFrame())
{ {
iterator liNext = li; lstEvent.insert(lstEvent.end(), *li);
++liNext; li = erase(li);
erase(li);
li = liNext;
lstEvent.insert(lstEvent.end(),e);
} }
else else
++li; ++li;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment