Skip to content

Commit 57dceb1

Browse files
committed
using a simpler hash, minimizing changes to the original state
1 parent c4bf1ed commit 57dceb1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/_libs/src/klib/khash_python.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ khint32_t PANDAS_INLINE kh_python_hash_func(PyObject* key){
196196
// for 64bit builds,
197197
// we need information of the upper 32bits as well
198198
// see GH 37615
199-
return kh_int64_hash_func(hash);
199+
khuint64_t as_uint = (khuint64_t) hash;
200+
// uints avoid undefined behavior of signed ints
201+
return (as_uint>>32)^as_uint;
200202
#endif
201203
}
202204

0 commit comments

Comments
 (0)