mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
follow up to #9778: define and use an unsigned hash type
This commit is contained in:
parent
2b9af63b4f
commit
8035bc5c04
7 changed files with 22 additions and 20 deletions
|
@ -2555,7 +2555,7 @@ long_richcompare(PyObject *self, PyObject *other, int op)
|
|||
static Py_hash_t
|
||||
long_hash(PyLongObject *v)
|
||||
{
|
||||
unsigned long x;
|
||||
Py_uhash_t x;
|
||||
Py_ssize_t i;
|
||||
int sign;
|
||||
|
||||
|
@ -2604,8 +2604,8 @@ long_hash(PyLongObject *v)
|
|||
x -= _PyHASH_MODULUS;
|
||||
}
|
||||
x = x * sign;
|
||||
if (x == (unsigned long)-1)
|
||||
x = (unsigned long)-2;
|
||||
if (x == (Py_uhash_t)-1)
|
||||
x = (Py_uhash_t)-2;
|
||||
return (Py_hash_t)x;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue