diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-31 08:07:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-31 08:25:40 +0100 |
commit | 01a8d79fd76f7e523169c56a22be8ff84d8cd76a (patch) | |
tree | df0503b038b2f10f6fa331212240ddc7402796f8 /sax/source | |
parent | 498a8d0bb6cc9534e84e7738f87c5ba5d06c2bbe (diff) |
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>
Diffstat (limited to 'sax/source')
-rw-r--r-- | sax/source/tools/fastattribs.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index 8aff8569d903..91df59d05107 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -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++ ); |