diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-07 16:25:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-08 08:52:09 +0200 |
commit | 7be675cdfad328667bfbab043d71539dfd9e6fe6 (patch) | |
tree | 94a83c67d26aaffb513863a6ab0e4f8f72b2dc4d /include/xmloff | |
parent | 1d556ff84dce01531ee334dc1408cebe50e97d22 (diff) |
improve combining in hash functions
specifically, use boost::hash_combine to combine values in hash
functions, except for a couple of places where I use the
small-prime-number strategy popular in the Java world, to avoid
including boost in header files that are widely shared.
Change-Id: I0e184c9ec8803bf09fc6e84fe20131b203e1652a
Reviewed-on: https://gerrit.libreoffice.org/70384
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/xmloff')
-rw-r--r-- | include/xmloff/nmspmap.hxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/xmloff/nmspmap.hxx b/include/xmloff/nmspmap.hxx index 127d5b59f06b..1eb0f8f15b95 100644 --- a/include/xmloff/nmspmap.hxx +++ b/include/xmloff/nmspmap.hxx @@ -56,7 +56,10 @@ struct QNamePairHash { size_t operator()( const QNamePair &r1 ) const { - return static_cast<size_t>(r1.second.hashCode()) + r1.first; + size_t hash = 17; + hash = hash * 37 + r1.first; + hash = hash * 37 + r1.second.hashCode(); + return hash; } }; |