summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-12-16 17:55:46 (GMT)
committerGuido van Rossum <guido@python.org>1996-12-16 17:55:46 (GMT)
commit0969ad213d73a052e66ebf83cb4eae48a0dd7b55 (patch)
tree10d12fda01837c5c11b081f578ab5a2f0f52ca79 /Objects
parentcc15b42e5919548e8d7008776f4c87f2267a00b3 (diff)
downloadcpython-0969ad213d73a052e66ebf83cb4eae48a0dd7b55.zip
cpython-0969ad213d73a052e66ebf83cb4eae48a0dd7b55.tar.gz
cpython-0969ad213d73a052e66ebf83cb4eae48a0dd7b55.tar.bz2
Better tuple hash function.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/tupleobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index fe3da55..fd53c30 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -233,7 +233,7 @@ tuplehash(v)
y = hashobject(*p++);
if (y == -1)
return -1;
- x = (x + x + x) ^ y;
+ x = (1000003*x) ^ y;
}
x ^= v->ob_size;
if (x == -1)