diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-19 10:56:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-19 11:04:16 +0200 |
commit | 8d057b3ca924cca0aafcaabf250189cf6aa41cfd (patch) | |
tree | 7c0a716f14c8df2167211767a689793a8f531036 /lotuswordpro | |
parent | 153ea761e32238d1dd882823cf27da1b11c4d66a (diff) |
Use a more straightforward hash function
...instead of assembling a OUString and calling OUString::hashCode. It appears
that these hash values are only used in std::unordered_map instantiations, not
used as part of a stable file format.
Change-Id: Ie3f78b2cc9e162ac9777c7e5f4164a12bc9a62a4
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpobjid.hxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lotuswordpro/source/filter/lwpobjid.hxx b/lotuswordpro/source/filter/lwpobjid.hxx index 33c34299396b..05e1fb769f56 100644 --- a/lotuswordpro/source/filter/lwpobjid.hxx +++ b/lotuswordpro/source/filter/lwpobjid.hxx @@ -150,16 +150,8 @@ inline void LwpObjectID::SetHigh(sal_uInt16 nh) } inline size_t LwpObjectID::HashCode() const { - OUString str; - if(m_nIndex) - { - str = OUString(m_nIndex) + OUString(m_nHigh); - } - else - { - str = OUString(m_nLow) + OUString(m_nHigh); - } - return str.hashCode(); + return static_cast<size_t>( + (m_nIndex == 0 ? 23 * m_nLow : 27 * m_nIndex) + 29 * m_nHigh); } #endif |