tdf#125688, special-case empty return

in FastAttributeList::getUnknownAttributes,
shaves 5% off load time

Change-Id: I5acac243d7af0c6fb44cbc15832f9d322fa6c7f4
Reviewed-on: https://gerrit.libreoffice.org/81819
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2019-10-31 08:07:26 +02:00
parent 498a8d0bb6
commit 01a8d79fd7

View File

@ -234,7 +234,10 @@ OUString FastAttributeList::getOptionalValue( ::sal_Int32 Token )
}
Sequence< Attribute > FastAttributeList::getUnknownAttributes( )
{
Sequence< Attribute > aSeq( maUnknownAttributes.size() );
auto nSize = maUnknownAttributes.size();
if (nSize == 0)
return {};
Sequence< Attribute > aSeq( nSize );
Attribute* pAttr = aSeq.getArray();
for( const auto& rAttr : maUnknownAttributes )
rAttr.FillAttribute( pAttr++ );