Kaydet (Commit) 06d39b86 authored tarafından Noel Grandin's avatar Noel Grandin

tdf#125372 writer, file with lots of hints very slow to open, part2

Reduce unnecessary scanning on MarkManager::deleteMark

Change-Id: I4af07877a98b12f20f486974eb77ee2989a2fbc9
Reviewed-on: https://gerrit.libreoffice.org/72949
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c74f6334
......@@ -1018,20 +1018,19 @@ namespace sw { namespace mark
" - Mark is not in my doc.");
// finds the last Mark that is starting before pMark
// (pMarkLow < pMark)
iterator_t pMarkLow =
lower_bound(
auto it = lower_bound(
m_vAllMarks.begin(),
m_vAllMarks.end(),
pMark->GetMarkStart(),
sw::mark::CompareIMarkStartsBefore());
iterator_t pMarkHigh = m_vAllMarks.end();
iterator_t pMarkFound =
find_if(
pMarkLow,
pMarkHigh,
[pMark] (pMark_t const& rpMark) { return rpMark.get() == pMark; } );
if(pMarkFound != pMarkHigh)
deleteMark(pMarkFound);
for ( ; it != m_vAllMarks.end(); ++it)
if (pMark->StartsBefore((*it)->GetMarkStart()))
break;
else if (it->get() == pMark)
{
deleteMark(it);
break;
}
}
void MarkManager::clearAllMarks()
......
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