bpo-26163: Frozenset hash improvement (#5194)

This commit is contained in:
Raymond Hettinger 2018-01-16 01:30:26 -08:00 committed by GitHub
parent 94e1696d04
commit b44c5169f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -795,6 +795,7 @@ frozenset_hash(PyObject *self)
hash ^= ((Py_uhash_t)PySet_GET_SIZE(self) + 1) * 1927868237UL;
/* Disperse patterns arising in nested frozensets */
hash ^= (hash >> 11) ^ (~hash >> 25);
hash = hash * 69069U + 907133923UL;
/* -1 is reserved as an error code */