summaryrefslogtreecommitdiff
path: root/stoc
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 /stoc
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 'stoc')
-rw-r--r--stoc/source/invocation_adapterfactory/iafactory.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 7e2aca96856e..060170fe420f 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -21,6 +21,7 @@
#include <osl/diagnose.h>
#include <osl/interlck.h>
#include <osl/mutex.hxx>
+#include <o3tl/sorted_vector.hxx>
#include <sal/log.hxx>
#include <uno/dispatcher.h>
@@ -78,7 +79,7 @@ struct hash_ptr
}
-typedef std::unordered_set< void *, hash_ptr > t_ptr_set;
+typedef o3tl::sorted_vector< void * > t_ptr_set;
typedef std::unordered_map< void *, t_ptr_set, hash_ptr > t_ptr_map;
namespace {
@@ -825,7 +826,7 @@ Reference< XInterface > FactoryImpl::createAdapter(
&adapter_set, m_receiver2adapters, xKey.get(), rTypes );
if (nullptr == that) // again no entry
{
- pair< t_ptr_set::iterator, bool > i(adapter_set->insert(pNew));
+ pair< t_ptr_set::const_iterator, bool > i(adapter_set->insert(pNew));
SAL_WARN_IF(
!i.second, "stoc",
"set already contains " << *(i.first) << " != " << pNew);