diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2013-11-26 16:26:12 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2013-11-26 17:33:44 +0000 |
commit | d7280af9740819971f46a855108334b84778b47d (patch) | |
tree | 12f13fe1c9afcaa2b2e4ab3a7d22a70bda710c23 /oox/source/token | |
parent | 2d681ad020d3cd6beb53a0de1c3057537f31c8df (diff) |
fastparser: Avoid copying all tokens into a sequence.
Diffstat (limited to 'oox/source/token')
-rw-r--r-- | oox/source/token/tokenmap.cxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index ea3e621e3792..7728b26bff06 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -113,17 +113,9 @@ Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const return Sequence< sal_Int8 >(); } -sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) const +sal_Int32 TokenMap::getTokenPerfectHash( const char *pStr, sal_Int32 nLength ) const { - // 50% of OOXML tokens are primarily 1 lower-case character, a-z - if( rUtf8Name.getLength() == 1) - { - sal_Char c = rUtf8Name[0]; - if (c >= 'a' && c <= 'z') - return mnAlphaTokens[ c - 'a' ]; - } - struct xmltoken* pToken = Perfect_Hash::in_word_set( - reinterpret_cast< const char* >( rUtf8Name.getConstArray() ), rUtf8Name.getLength() ); + struct xmltoken* pToken = Perfect_Hash::in_word_set( pStr, nLength ); return pToken ? pToken->nToken : XML_TOKEN_INVALID; } |