]> granicus.if.org Git - python/commitdiff
Better tuple hash function.
authorGuido van Rossum <guido@python.org>
Mon, 16 Dec 1996 17:55:46 +0000 (17:55 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 16 Dec 1996 17:55:46 +0000 (17:55 +0000)
Objects/tupleobject.c

index fe3da5576f54f21e69a51b8c5a842653345fcffe..fd53c300cb638b2821180f1a9419070fdcc14e44 100644 (file)
@@ -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)