summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-21 09:33:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-21 12:34:08 +0100
commite8833d4dd9322c01cf5b6d458fc86d3735cf9999 (patch)
tree6c414b51fe0938e9bfee5ff91fc476f4590795c9
parent06c740aafc1b21468de3a631d117d74a520e4db6 (diff)
ofz#11275 erase via position
rather than searching pointer each time Change-Id: I0db8990b39cce024fbf0bfc6ebd091a5fa210c02 Reviewed-on: https://gerrit.libreoffice.org/66665 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/doc/docredln.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index c1873fbaad74..47f9f9227506 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -623,10 +623,11 @@ void SwRedlineTable::Remove( size_type nP )
void SwRedlineTable::DeleteAndDestroyAll()
{
- while (!maVector.empty())
+ auto nCount = maVector.size();
+ while (nCount)
{
auto const pRedline = maVector.back();
- maVector.erase(maVector.back());
+ maVector.erase(--nCount);
LOKRedlineNotification(RedlineNotification::Remove, pRedline);
delete pRedline;
}