diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-29 09:16:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-29 12:57:47 +0200 |
commit | 1094fedfac9d48262400e2a07581bfa36b2a422e (patch) | |
tree | d25b5741aa2d54825bb41f5473832d2bc8213b62 /include/oox/token | |
parent | 649228f932321c2c5784fbf7b0df84712fde55a0 (diff) |
getUtf8TokenName can return by const ref
and avoid some reference-counting in a hot path
Change-Id: I7f5fd7f8f5f9076eb5f8d60118afa8e3ac8a5e6c
Reviewed-on: https://gerrit.libreoffice.org/38129
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/oox/token')
-rw-r--r-- | include/oox/token/tokenmap.hxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/oox/token/tokenmap.hxx b/include/oox/token/tokenmap.hxx index 2f499698c9a6..b5c14f20749b 100644 --- a/include/oox/token/tokenmap.hxx +++ b/include/oox/token/tokenmap.hxx @@ -42,13 +42,13 @@ public: static sal_Int32 getTokenFromUnicode( const OUString& rUnicodeName ); /** Returns the UTF8 name of the passed token identifier as byte sequence. */ - css::uno::Sequence< sal_Int8 > + css::uno::Sequence< sal_Int8 > const & getUtf8TokenName( sal_Int32 nToken ) const { SAL_WARN_IF(nToken < 0 || nToken >= XML_TOKEN_COUNT, "oox", "Wrong nToken parameter"); if (0 <= nToken && nToken < XML_TOKEN_COUNT) return maTokenNames[ nToken ]; - return css::uno::Sequence< sal_Int8 >(); + return EMPTY_BYTE_SEQ; } /** Returns the token identifier for the passed UTF8 token name. */ @@ -75,6 +75,7 @@ public: private: static sal_Int32 getTokenPerfectHash( const char *pToken, sal_Int32 nLength ); + static const css::uno::Sequence< sal_Int8 > EMPTY_BYTE_SEQ; typedef ::std::vector< css::uno::Sequence< sal_Int8 > > TokenNameVector; |