summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-17 11:43:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-18 08:38:00 +0200
commit2a6d510b5bb1503ae12e5ccc921b0ab7032c8e65 (patch)
tree4a87532ceedb4ac6b05be4c9c0d88c4d54848eee /svl
parent2672b4a94cc3416bc7df1520d4a3f318ef6395d4 (diff)
speed up sw_filters_test2
in dbgutil mode, this takes the test from 2m31 to 1m45 for me. find(), even on a sorted vector, is rather slow in debug mode, and we can avoid one find here Change-Id: I8f82aaf5b8d82a32c78bf7c9df5712c90c68f7fc Reviewed-on: https://gerrit.libreoffice.org/75764 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/inc/poolio.hxx5
-rw-r--r--svl/source/items/itempool.cxx1
2 files changed, 4 insertions, 2 deletions
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 207dffded624..021b85924a65 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -61,7 +61,10 @@ public:
o3tl::sorted_vector<SfxPoolItem*>::const_iterator find(SfxPoolItem* pItem) const { return maPoolItemSet.find(pItem); }
void insert(SfxPoolItem* pItem)
{
- maPoolItemSet.insert(pItem);
+ bool bInserted = maPoolItemSet.insert(pItem).second;
+ assert( bInserted && "duplicate item?" );
+ (void)bInserted;
+
if (pItem->IsSortable())
{
// bail early if someone modified one of these things underneath me
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 70809ac65ad4..82668c909a35 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -680,7 +680,6 @@ const SfxPoolItem& SfxItemPool::PutImpl( const SfxPoolItem& rItem, sal_uInt16 nW
AddRef( *pNewItem );
// 4. finally insert into the pointer array
- assert( rItemArr.find(pNewItem) == rItemArr.end() );
rItemArr.insert( pNewItem );
return *pNewItem;
}