diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-02-01 08:29:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-01 08:19:54 +0100 |
commit | 1a12861e01acd7a0c879a1124dd9ed4297a03dca (patch) | |
tree | c2d555f7772a7580063d9ec72e73e23e5ea2d6ed /sc/inc/externalrefmgr.hxx | |
parent | 07b84ff631bd3c8db1188f69804036505753feff (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 'sc/inc/externalrefmgr.hxx')
-rw-r--r-- | sc/inc/externalrefmgr.hxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index b95d6d1a0fd1..128feab61894 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -39,6 +39,7 @@ #include <unordered_set> #include <vector> #include <set> +#include <o3tl/sorted_vector.hxx> #include <formula/ExternalReferenceHelper.hxx> class ScTokenArray; @@ -381,14 +382,6 @@ public: LinkListener(); virtual ~LinkListener() COVERITY_NOEXCEPT_FALSE = 0; virtual void notify(sal_uInt16 nFileId, LinkUpdateType eType) = 0; - - struct Hash - { - size_t operator() (const LinkListener* p) const - { - return reinterpret_cast<size_t>(p); - } - }; }; /** @@ -421,7 +414,7 @@ private: typedef std::unordered_map<sal_uInt16, SvNumberFormatterMergeMap> NumFmtMap; - typedef std::unordered_set<LinkListener*, LinkListener::Hash> LinkListeners; + typedef o3tl::sorted_vector<LinkListener*> LinkListeners; typedef std::unordered_map<sal_uInt16, LinkListeners> LinkListenerMap; public: |