Skip to content

Commit c5685a6

Browse files
authored
Merge pull request #30850 from charris/backport-30840
BUG: Fix weak hash function in np.isin(). (#30840)
2 parents a5d4cb5 + e24c0dc commit c5685a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

numpy/_core/src/multiarray/unique.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ empty_array_like(PyArrayObject *arr, npy_intp length)
6363

6464
template <typename T>
6565
size_t hash_integer(const T *value, npy_bool equal_nan) {
66-
return std::hash<T>{}(*value);
66+
return npy_fnv1a(reinterpret_cast<const unsigned char*>(value), sizeof(T));
6767
}
6868

6969
template <typename S, typename T, S (*real)(T), S (*imag)(T)>

0 commit comments

Comments
 (0)