Mercurial > cpython-lru_cache-weakref
diff Objects/bytesobject.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 | beac7d6c7be4 |
| children | 960d93deb8c2 40e1be1e0707 |
line wrap: on
line diff
--- a/Objects/bytesobject.c Sat Jan 14 22:23:27 2012 +0100 +++ b/Objects/bytesobject.c Sat Jan 14 15:31:34 2012 -0800 @@ -881,7 +881,7 @@ p = (unsigned char *) a->ob_sval; x = *p << 7; while (--len >= 0) - x = (1000003*x) ^ *p++; + x = (_PyHASH_MULTIPLIER*x) ^ *p++; x ^= Py_SIZE(a); if (x == -1) x = -2;
