From: Guido van Rossum Date: Mon, 16 Dec 1996 17:55:46 +0000 (+0000) Subject: Better tuple hash function. X-Git-Tag: v1.5a1~743 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0969ad213d73a052e66ebf83cb4eae48a0dd7b55;p=python Better tuple hash function. --- diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index fe3da5576f..fd53c300cb 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)