[Python-checkins] Removed unnecesssary bit inversion which doesn't improve dispersion statistics (GH-5235) (#5236)

Raymond Hettinger webhook-mailer at python.org
Thu Jan 18 17:27:24 EST 2018


https://github.com/python/cpython/commit/051650ab8de620dd7e3c557f8227c43439ea8c6a
commit: 051650ab8de620dd7e3c557f8227c43439ea8c6a
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Raymond Hettinger <rhettinger at users.noreply.github.com>
date: 2018-01-18T14:27:22-08:00
summary:

Removed unnecesssary bit inversion which doesn't improve dispersion statistics (GH-5235) (#5236)

(cherry picked from commit fa7880604191f81cbdddc191216f7b1e39a74d8d)

files:
M Objects/setobject.c

diff --git a/Objects/setobject.c b/Objects/setobject.c
index 093a15f367f..c742041b16d 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -790,7 +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 >> 11) ^ (hash >> 25);
     hash = hash * 69069U + 907133923UL;
 
     /* -1 is reserved as an error code */



More information about the Python-checkins mailing list