summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2013-11-23 10:02:34 +0000
committerMichael Meeks <michael.meeks@collabora.com>2013-11-23 10:06:26 +0000
commit4dd1f85094620506317dafc223d38e6c392b6599 (patch)
tree2f71a4a3a54e05cd1bf06cdd3ad760f41815fa07
parentc9fcb7933c9a4233c0ccb0951068840db1cb9ad6 (diff)
fastparser: avoid allocation and conversion of elementnames we don't need.
Change-Id: I4c09aaa12b53181e50662de2721d170c195c7c86
-rw-r--r--sax/source/fastparser/fastparser.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 8f68051eccd1..da224d0a62fe 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -998,14 +998,18 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char
rEvent.mnElementToken = GetToken( pName );
if( rEvent.mnElementToken == FastToken::DONTKNOW )
+ {
if( nPrefixLen > 0 )
{
rEvent.msNamespace = GetNamespaceURL( pPrefix, nPrefixLen );
nNamespaceToken = GetNamespaceToken( rEvent.msNamespace );
}
+ rEvent.msElementName = OUString( pName, nNameLen, RTL_TEXTENCODING_UTF8 );
+ }
+ else // token is always preferred.
+ rEvent.msElementName = OUString( "" );
rEntity.maNamespaceStack.push( NameWithToken(rEvent.msNamespace, nNamespaceToken) );
- rEvent.msElementName = OUString(pName, nNameLen, RTL_TEXTENCODING_UTF8);
if (rEntity.mbEnableThreads)
produce( START_ELEMENT );
else