[Libreoffice-commits] core.git: svl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 18 06:38:59 UTC 2019
svl/source/inc/poolio.hxx | 5 ++++-
svl/source/items/itempool.cxx | 1 -
2 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 2a6d510b5bb1503ae12e5ccc921b0ab7032c8e65
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 17 11:43:42 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 18 08:38:00 2019 +0200
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 at collabora.co.uk>
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;
}
More information about the Libreoffice-commits
mailing list