summaryrefslogtreecommitdiff
path: root/comphelper/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-11 11:00:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-11 15:16:17 +0200
commitb03aa654eb2e2980f3efc0347b1435414d8f1d09 (patch)
tree4c818f88d9ffb4857778bd11e7b851fd0410ac50 /comphelper/source
parent52a0f9e6b881c21275358de3ec9b4c85f77402e4 (diff)
cache the Sequence we return in comphelper::PropertySetInfo::getProperties
Change-Id: If4e6e43be5d7380665e56bf95c446ff14e6a7213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134155 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper/source')
-rw-r--r--comphelper/source/property/propertysetinfo.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/comphelper/source/property/propertysetinfo.cxx b/comphelper/source/property/propertysetinfo.cxx
index 049827d7e45f..919198772932 100644
--- a/comphelper/source/property/propertysetinfo.cxx
+++ b/comphelper/source/property/propertysetinfo.cxx
@@ -37,7 +37,7 @@ void PropertySetInfo::addImpl(PropertyMapEntry const * pMap) noexcept
maPropertyMap[pMap->maName] = pMap;
- maProperties.clear();
+ maProperties.realloc(0);
++pMap;
}
@@ -90,7 +90,7 @@ void PropertySetInfo::add( PropertyMapEntry const * pMap ) noexcept
void PropertySetInfo::remove( const OUString& aName ) noexcept
{
maPropertyMap.erase( aName );
- maProperties.clear();
+ maProperties.realloc(0);
}
Sequence< css::beans::Property > SAL_CALL PropertySetInfo::getProperties()
@@ -100,8 +100,8 @@ Sequence< css::beans::Property > SAL_CALL PropertySetInfo::getProperties()
// to getProperties
if( maProperties.size() != maPropertyMap.size() )
{
- maProperties.resize( maPropertyMap.size() );
- auto propIter = maProperties.begin();
+ maProperties.realloc( maPropertyMap.size() );
+ auto propIter = maProperties.getArray();
for( const auto& rProperty : maPropertyMap )
{
@@ -115,7 +115,7 @@ Sequence< css::beans::Property > SAL_CALL PropertySetInfo::getProperties()
++propIter;
}
}
- return comphelper::containerToSequence(maProperties);
+ return maProperties;
}
Property SAL_CALL PropertySetInfo::getPropertyByName( const OUString& aName )