Mercurial > cpython-lru_cache-weakref
diff Objects/tupleobject.c @ 65603:be8ae6b17539
follow up to #9778: define and use an unsigned hash type
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 Oct 2010 16:20:50 +0000 |
| parents | e8969fb822fc |
| children | 62b61abd02b8 |
line wrap: on
line diff
--- a/Objects/tupleobject.c Sat Oct 23 01:15:30 2010 +0000 +++ b/Objects/tupleobject.c Sat Oct 23 16:20:50 2010 +0000 @@ -318,7 +318,7 @@ register Py_hash_t x, y; register Py_ssize_t len = Py_SIZE(v); register PyObject **p; - long mult = 1000003L; + Py_hash_t mult = 1000003L; x = 0x345678L; p = v->ob_item; while (--len >= 0) { @@ -327,7 +327,7 @@ return -1; x = (x ^ y) * mult; /* the cast might truncate len; that doesn't change hash stability */ - mult += (long)(82520L + len + len); + mult += (Py_hash_t)(82520L + len + len); } x += 97531L; if (x == -1)
