diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-11 09:26:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-11 10:27:57 +0200 |
commit | 3a22f5a589e822e7ca8bbb00e38a3aff93ed7ba5 (patch) | |
tree | 1220c986910b22c20f4e933f44a738098635452a /xmloff | |
parent | 627e13079adb5ff6281530c9584da9065d6410ab (diff) |
optimisation: used std::vector for list of integers
Change-Id: I98b211d632f0282faeaa30e971841faae89bfeff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/xmlexppr.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index ec108f67beb5..92ba262a1921 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -151,16 +151,16 @@ void XMLPropertyStates_Impl::FillPropertyStateVector( class FilterPropertyInfo_Impl { - const OUString sApiName; - std::list<sal_uInt32> aIndexes; + OUString msApiName; + std::vector<sal_uInt32> maIndexes; public: FilterPropertyInfo_Impl( const OUString& rApiName, const sal_uInt32 nIndex); - const OUString& GetApiName() const { return sApiName; } - std::list<sal_uInt32>& GetIndexes() { return aIndexes; } + const OUString& GetApiName() const { return msApiName; } + std::vector<sal_uInt32>& GetIndexes() { return maIndexes; } // for sort bool operator< ( const FilterPropertyInfo_Impl& rArg ) const @@ -172,9 +172,9 @@ public: FilterPropertyInfo_Impl::FilterPropertyInfo_Impl( const OUString& rApiName, const sal_uInt32 nIndex ) : - sApiName( rApiName ) + msApiName( rApiName ) { - aIndexes.push_back(nIndex); + maIndexes.push_back(nIndex); } typedef std::list<FilterPropertyInfo_Impl> FilterPropertyInfoList_Impl; @@ -242,7 +242,12 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames() if ( aOld->GetApiName() == aCurrent->GetApiName() ) { // if equal: merge index lists - aOld->GetIndexes().merge( aCurrent->GetIndexes() ); + std::vector<sal_uInt32> aMerged; + std::merge(aOld->GetIndexes().begin(), aOld->GetIndexes().end(), + aCurrent->GetIndexes().begin(), aCurrent->GetIndexes().end(), + std::back_inserter(aMerged)); + aOld->GetIndexes() = std::move(aMerged); + aCurrent->GetIndexes().clear(); // erase element, and continue with next aCurrent = aPropInfos.erase( aCurrent ); nCount--; |