summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-07-06 14:50:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-06 15:49:15 +0200
commit67631563537623c44e5c6905e0df522ad204bfc9 (patch)
tree547cbe0086d6b3453887ff4f74db04c6f576be9a /sax
parentc6923103a2d952aecb154223663688a085065b05 (diff)
shave some cost off SaxContext
most of the time, we can skip the ref-counting associated with these string fields Change-Id: I7afc1aa08f3337d7c61478eab92abc2cdd2b9d1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136843 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/fastparser/fastparser.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 250078bc5054..00ea75e23c6b 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -107,16 +107,16 @@ struct SaxContext
{
Reference< XFastContextHandler > mxContext;
sal_Int32 mnElementToken;
- OUString maNamespace;
- OUString maElementName;
+ std::optional<OUString> moNamespace;
+ std::optional<OUString> moElementName;
SaxContext( sal_Int32 nElementToken, const OUString& aNamespace, const OUString& aElementName ):
mnElementToken(nElementToken)
{
if (nElementToken == FastToken::DONTKNOW)
{
- maNamespace = aNamespace;
- maElementName = aElementName;
+ moNamespace = aNamespace;
+ moElementName = aElementName;
}
}
};
@@ -514,7 +514,7 @@ void Entity::endElement()
if( nElementToken != FastToken::DONTKNOW )
pContext->endFastElement( nElementToken );
else
- pContext->endUnknownElement( aContext.maNamespace, aContext.maElementName );
+ pContext->endUnknownElement( *aContext.moNamespace, *aContext.moElementName );
}
catch (...)
{