summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-02-01 08:29:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-01 08:19:54 +0100
commit1a12861e01acd7a0c879a1124dd9ed4297a03dca (patch)
treec2d555f7772a7580063d9ec72e73e23e5ea2d6ed /sw
parent07b84ff631bd3c8db1188f69804036505753feff (diff)
std::unordered_set<T*> -> o3tl::sorted_vector
which is much better for CPU cache, since the representation is more compact, and since we almost always do insert() in pointer order, there is surprisingly little sorting Also add a count() method for compatibility with std::set and the proposed std::flat_set Change-Id: I2a3211dc59919cfec5cac1497530a4c3600d50ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87793 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/swwait.hxx4
-rw-r--r--sw/source/core/doc/docnew.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/sw/inc/swwait.hxx b/sw/inc/swwait.hxx
index ed256de76c12..ff9a4ad773a2 100644
--- a/sw/inc/swwait.hxx
+++ b/sw/inc/swwait.hxx
@@ -21,7 +21,7 @@
#include "swdllapi.h"
-#include <unordered_set>
+#include <o3tl/sorted_vector.hxx>
class SwDocShell;
class SfxDispatcher;
@@ -42,7 +42,7 @@ private:
SwDocShell& mrDoc;
const bool mbLockUnlockDispatcher;
- std::unordered_set< SfxDispatcher* > mpLockedDispatchers;
+ o3tl::sorted_vector< SfxDispatcher* > mpLockedDispatchers;
};
#endif
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 1547ebf19abc..8c64c6a2862c 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -19,7 +19,7 @@
#include <config_features.h>
-#include <unordered_set>
+#include <o3tl/sorted_vector.hxx>
#include <doc.hxx>
#include <proofreadingiterator.hxx>
@@ -915,7 +915,7 @@ static OUString lcl_FindUniqueName(SwWrtShell* pTargetShell, const OUString& rSt
static bool lcl_PageDescOrFollowContainsHeaderFooter(const SwPageDesc& rPageDesc)
{
// remember already checked page descs to avoid cycle
- std::unordered_set<const SwPageDesc*> aCheckedPageDescs;
+ o3tl::sorted_vector<const SwPageDesc*> aCheckedPageDescs;
const SwPageDesc* pCurPageDesc = &rPageDesc;
while (aCheckedPageDescs.count(pCurPageDesc) == 0)
{