summaryrefslogtreecommitdiff
path: root/sax/source/fastparser/fastparser.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2013-11-19 20:51:35 +0000
committerMichael Meeks <michael.meeks@collabora.com>2013-11-19 20:52:50 +0000
commitfc25afaa048033940d9e1d22ec8ba31c5b3e9289 (patch)
treee5368871ba27a66cad29b50f064a819087af60d5 /sax/source/fastparser/fastparser.cxx
parent7e77efe8b8f04ba739f731e5a27b5e643fe652fa (diff)
fastparser: accelerate value tokenisation as well.
Change-Id: I99a39e91c684adb1fc92cdb466477cfa90104961
Diffstat (limited to 'sax/source/fastparser/fastparser.cxx')
-rw-r--r--sax/source/fastparser/fastparser.cxx27
1 files changed, 1 insertions, 26 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 5d64a10b5f7f..8f68051eccd1 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -348,7 +348,6 @@ Event& Entity::getEvent( CallbackType aType )
FastSaxParser::FastSaxParser()
{
mxDocumentLocator.set( new FastLocatorImpl( this ) );
- maUtf8Buffer.realloc( mnUtf8BufferSize );
}
// --------------------------------------------------------------------
@@ -381,31 +380,7 @@ void FastSaxParser::DefineNamespace( const OString& rPrefix, const sal_Char* pNa
sal_Int32 FastSaxParser::GetToken( const sal_Char* pToken, sal_Int32 nLen /* = 0 */ )
{
- sal_Int32 nRet;
-
- if( !nLen )
- nLen = strlen( pToken );
-
- if ( nLen < mnUtf8BufferSize )
- {
- // Get intimiate with the underlying sequence cf. sal/types.h
- sal_Sequence *pSeq = maUtf8Buffer.get();
-
- sal_Int32 nPreRefCount = pSeq->nRefCount;
-
- pSeq->nElements = nLen;
- memcpy( pSeq->elements, pToken, nLen );
- nRet = getEntity().mxTokenHandler->getTokenFromUTF8( maUtf8Buffer );
-
- (void)nPreRefCount; // for non-debug mode.
- assert( pSeq->nRefCount == nPreRefCount ); // callee must not take ref.
- }
- else
- {
- Sequence< sal_Int8 > aSeq( (sal_Int8*)pToken, nLen ); // heap allocate & free
- nRet = getEntity().mxTokenHandler->getTokenFromUTF8( aSeq );
- }
- return nRet;
+ return maTokenLookup.getTokenFromChars( getEntity().mxTokenHandler, pToken, nLen );
}
// --------------------------------------------------------------------