summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-07-05 20:30:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-07-06 10:15:09 +0200
commitae2235ccf0663329f0ef69432298b71424a4217b (patch)
tree937eea8eed06c8878b0a71c75106805845cab4ef /svl
parent7aba05331b0e14d3ce2c811a4dc18d4714a7a575 (diff)
use o3tl::sorted_vector in DefaultItemInstanceManager
Change-Id: I16426008dd8983d56a49b3334b3f163ec350be0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170057 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/globalpool.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/svl/source/items/globalpool.cxx b/svl/source/items/globalpool.cxx
index 313db586a566..32ca159fe7a7 100644
--- a/svl/source/items/globalpool.cxx
+++ b/svl/source/items/globalpool.cxx
@@ -22,6 +22,7 @@
#include <svl/poolitem.hxx>
#include <svl/setitem.hxx>
#include <sal/log.hxx>
+#include <o3tl/sorted_vector.hxx>
#include <unordered_map>
#include <unordered_set>
#include <memory>
@@ -102,7 +103,9 @@ struct ItemInstanceManager
// that specific Item (see other derivations)
struct DefaultItemInstanceManager : public ItemInstanceManager
{
- std::unordered_set<const SfxPoolItem*> maRegistered;
+ // This workload is very read-heavy, and we want to scan the candidates often, so
+ // a vector-based data structure is faster.
+ o3tl::sorted_vector<const SfxPoolItem*> maRegistered;
virtual const SfxPoolItem* find(const SfxPoolItem& rItem) const override
{