Kaydet (Commit) 8d057b3c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 153ea761
...@@ -150,16 +150,8 @@ inline void LwpObjectID::SetHigh(sal_uInt16 nh) ...@@ -150,16 +150,8 @@ inline void LwpObjectID::SetHigh(sal_uInt16 nh)
} }
inline size_t LwpObjectID::HashCode() const inline size_t LwpObjectID::HashCode() const
{ {
OUString str; return static_cast<size_t>(
if(m_nIndex) (m_nIndex == 0 ? 23 * m_nLow : 27 * m_nIndex) + 29 * m_nHigh);
{
str = OUString(m_nIndex) + OUString(m_nHigh);
}
else
{
str = OUString(m_nLow) + OUString(m_nHigh);
}
return str.hashCode();
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment