diff Objects/unicodeobject.c @ 74415:050c07b31192 3.2

Consolidate the occurrances of the prime used as the multiplier when hashing to a single #define instead of having several copies in several files. This excludes the Modules/ tree (datetime and expat both have a copy for their own purposes with no need for it to be the same).
author Gregory P. Smith <greg@krypto.org>
date Sat, 14 Jan 2012 15:31:34 -0800
parents 40a211eb4fda
children 572bb8c265c0 40e1be1e0707
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Sat Jan 14 22:23:27 2012 +0100
+++ b/Objects/unicodeobject.c	Sat Jan 14 15:31:34 2012 -0800
@@ -7666,7 +7666,7 @@
     p = self->str;
     x = *p << 7;
     while (--len >= 0)
-        x = (1000003*x) ^ *p++;
+        x = (_PyHASH_MULTIPLIER*x) ^ *p++;
     x ^= Py_SIZE(self);
     if (x == -1)
         x = -2;