sw/source/core/access/accmap.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
New commits: commit e3b990a47fc4b0b1191eb15a53badfc71aebc1fc Author: Michael Stahl <mst...@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 diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 7449a39..1f0fec9 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits