Kaydet (Commit) e7dbd065 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) Raymond Hettinger

bpo-26163: Frozenset hash improvement (GH-5194) (#5198)

(cherry picked from commit b44c5169)
üst b92c159e
Improved frozenset() hash to create more distinct hash values when faced
with datasets containing many similar values.
......@@ -790,6 +790,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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment