Use for-range loop for SdrMarkList::Clear

instead of calling n times GetMark

Change-Id: I5a00fd039d42b45dd491d8927dc1e44fe559ce3a
Reviewed-on: https://gerrit.libreoffice.org/48886
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet
2018-01-30 09:15:25 +01:00
parent 7c46d7f255
commit 3079e5a14c

View File

@@ -214,10 +214,9 @@ void SdrMarkList::ImpForceSort()
void SdrMarkList::Clear()
{
for(size_t i = 0; i < GetMarkCount(); ++i)
for (auto const& elem : maList)
{
SdrMark* pMark = GetMark(i);
delete pMark;
delete elem;
}
maList.clear();
mbSorted = true; //we're empty, so can be considered sorted