sax/source/tools/fastattribs.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 01a8d79fd76f7e523169c56a22be8ff84d8cd76a Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Oct 31 08:07:26 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Oct 31 08:25:40 2019 +0100 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.gran...@collabora.co.uk> 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++ ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits