summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-01 17:03:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-01 18:59:24 +0200
commit9634f5ee73e57e8cef75461316d5d45b06ee104f (patch)
treea32871029fa6cf3dccbd598c2bd94fef31774b7c
parent0547ca68c89b8726bc1b37828cd352fec80cbf26 (diff)
tdf#122926 FILEOPEN ODT Slower compared to the past
on my machine, this takes the time from 12.3s to 8.9s Change-Id: Ibdc7e3c34d1acb0d1f7f784720552fa6c7977fa5 Reviewed-on: https://gerrit.libreoffice.org/70074 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d384ce19b7d1..377618f2cab8 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1394,7 +1394,7 @@ void SwTextNode::Update(
bool bAtLeastOneBookmarkMoved = false;
bool bAtLeastOneExpandedBookmarkAtInsertionPosition = false;
// A text node already knows its marks via its SwIndexes.
- std::set<const sw::mark::IMark*> aSeenMarks;
+ std::unordered_set<const sw::mark::IMark*> aSeenMarks;
const SwIndex* next;
for (const SwIndex* pIndex = GetFirstIndex(); pIndex; pIndex = next )
{
@@ -1403,9 +1403,8 @@ void SwTextNode::Update(
if (!pMark)
continue;
// Only handle bookmarks once, if they start and end at this node as well.
- if (aSeenMarks.find(pMark) != aSeenMarks.end())
+ if (!aSeenMarks.insert(pMark).second)
continue;
- aSeenMarks.insert(pMark);
const SwPosition* pEnd = &pMark->GetMarkEnd();
SwIndex & rEndIdx = const_cast<SwIndex&>(pEnd->nContent);
if( this == &pEnd->nNode.GetNode() &&