summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-23 16:20:50 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-23 16:20:50 (GMT)
commit8035bc5c048ff08f652649754eb8ea769337afa0 (patch)
tree82778e9f0242d5a26e4ceba5d5b85babde6c12cf /Objects/tupleobject.c
parent2b9af63b4f4757cccad70b76960cfe8c7b9e6a49 (diff)
downloadcpython-8035bc5c048ff08f652649754eb8ea769337afa0.zip
cpython-8035bc5c048ff08f652649754eb8ea769337afa0.tar.gz
cpython-8035bc5c048ff08f652649754eb8ea769337afa0.tar.bz2
follow up to #9778: define and use an unsigned hash type
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index c55ad65..390b670 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -318,7 +318,7 @@ tuplehash(PyTupleObject *v)
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 @@ tuplehash(PyTupleObject *v)
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)