summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2018-01-16 09:30:26 (GMT)
committerGitHub <noreply@github.com>2018-01-16 09:30:26 (GMT)
commitb44c5169f64178d2ff2914187b315549e7ab0cb6 (patch)
treea6123ca1509df2bc83fd36a275f95f58e735e869 /Objects
parent94e1696d04c65e19ea52e5c8664079c9d9aa0e54 (diff)
downloadcpython-b44c5169f64178d2ff2914187b315549e7ab0cb6.zip
cpython-b44c5169f64178d2ff2914187b315549e7ab0cb6.tar.gz
cpython-b44c5169f64178d2ff2914187b315549e7ab0cb6.tar.bz2
bpo-26163: Frozenset hash improvement (#5194)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index c920fb9..4bc1020 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -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 */