mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
Consolidate the occurrances of the prime used as the multiplier when hashing.
This commit is contained in:
commit
f5b62a9b31
4 changed files with 7 additions and 4 deletions
|
@ -11210,7 +11210,7 @@ unicode_hash(PyObject *self)
|
|||
#define HASH(P) \
|
||||
x = (Py_uhash_t)*P << 7; \
|
||||
while (--len >= 0) \
|
||||
x = (1000003*x) ^ (Py_uhash_t)*P++;
|
||||
x = (_PyHASH_MULTIPLIER*x) ^ (Py_uhash_t)*P++;
|
||||
|
||||
switch (PyUnicode_KIND(self)) {
|
||||
case PyUnicode_1BYTE_KIND: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue