File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,12 @@ template<> struct DenseMapInfo<unsigned long> {
137137 static inline unsigned long getTombstoneKey () { return ~0UL - 1L ; }
138138
139139 static unsigned getHashValue (const unsigned long & Val) {
140- return (unsigned )(Val * 37UL );
140+ if constexpr (sizeof (Val) == 4 )
141+ return DenseMapInfo<unsigned >::getHashValue (Val);
142+ else
143+ return detail::combineHashValue (
144+ DenseMapInfo<unsigned >::getHashValue (Val),
145+ DenseMapInfo<unsigned >::getHashValue (Val >> 32 ));
141146 }
142147
143148 static bool isEqual (const unsigned long & LHS, const unsigned long & RHS) {
@@ -151,7 +156,9 @@ template<> struct DenseMapInfo<unsigned long long> {
151156 static inline unsigned long long getTombstoneKey () { return ~0ULL - 1ULL ; }
152157
153158 static unsigned getHashValue (const unsigned long long & Val) {
154- return (unsigned )(Val * 37ULL );
159+ return detail::combineHashValue (
160+ DenseMapInfo<unsigned >::getHashValue (Val),
161+ DenseMapInfo<unsigned >::getHashValue (Val >> 32 ));
155162 }
156163
157164 static bool isEqual (const unsigned long long & LHS,
You can’t perform that action at this time.
0 commit comments