diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2014-09-26 10:37:17 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-10-23 11:53:17 +0200 |
commit | e1c503a2e3309d9f738d7f702a562509899fdb3f (patch) | |
tree | 5aeee5c8b7f316de5f82ad6c70ad3fffc9b3dba2 /sax/source/tools | |
parent | b98b477c084c876a3a65583dbfed5c1f5f8bfe12 (diff) |
fastparser: avoid allocating un-used FastTokenLookup class.
This contained an rtl_Sequence complete with horror internal
allocator, caught red-handed serializing threaded loading to no
good purpose.
Change-Id: I837b2c17e4f70fd6a49bed33ad74a7d79f98f35c
Diffstat (limited to 'sax/source/tools')
-rw-r--r-- | sax/source/tools/fastattribs.cxx | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index 9d03772c8cae..45887b5754aa 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -127,9 +127,10 @@ sal_Int32 FastAttributeList::getValueToken( ::sal_Int32 Token ) throw (SAXExcept { for (size_t i = 0; i < maAttributeTokens.size(); ++i) if (maAttributeTokens[i] == Token) - return maTokenLookup.getTokenFromChars( mxTokenHandler, mpTokenHandler, - mpChunk + maAttributeValues[ i ], - AttributeValueLength( i ) ); + return FastTokenHandlerBase::getTokenFromChars( + mxTokenHandler, mpTokenHandler, + mpChunk + maAttributeValues[ i ], + AttributeValueLength( i ) ); throw SAXException(); } @@ -138,9 +139,10 @@ sal_Int32 FastAttributeList::getOptionalValueToken( ::sal_Int32 Token, ::sal_Int { for (size_t i = 0; i < maAttributeTokens.size(); ++i) if (maAttributeTokens[i] == Token) - return maTokenLookup.getTokenFromChars( mxTokenHandler, mpTokenHandler, - mpChunk + maAttributeValues[ i ], - AttributeValueLength( i ) ); + return FastTokenHandlerBase::getTokenFromChars( + mxTokenHandler, mpTokenHandler, + mpChunk + maAttributeValues[ i ], + AttributeValueLength( i ) ); return Default; } @@ -229,16 +231,7 @@ sal_Int32 FastAttributeList::AttributeValueLength(sal_Int32 i) return maAttributeValues[i + 1] - maAttributeValues[i] - 1; } -FastTokenLookup::FastTokenLookup() -{ - maUtf8Buffer.realloc( mnUtf8BufferSize ); -} - -/** - * Avoid doing any memory allocation if we can, instead keep a - * pet sequence around and do some heavy petting on it. - */ -sal_Int32 FastTokenLookup::getTokenFromChars( +sal_Int32 FastTokenHandlerBase::getTokenFromChars( const css::uno::Reference< css::xml::sax::XFastTokenHandler > &xTokenHandler, FastTokenHandlerBase *pTokenHandler, const char *pToken, size_t nLen /* = 0 */ ) |