File tree 1 file changed +9
-2
lines changed 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> {
137
137
static inline unsigned long getTombstoneKey () { return ~0UL - 1L ; }
138
138
139
139
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 ));
141
146
}
142
147
143
148
static bool isEqual (const unsigned long & LHS, const unsigned long & RHS) {
@@ -151,7 +156,9 @@ template<> struct DenseMapInfo<unsigned long long> {
151
156
static inline unsigned long long getTombstoneKey () { return ~0ULL - 1ULL ; }
152
157
153
158
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 ));
155
162
}
156
163
157
164
static bool isEqual (const unsigned long long & LHS,
You can’t perform that action at this time.
0 commit comments