[Python-checkins] cpython: Restore frozenset hash caching removed in cf707dd190a9

raymond.hettinger python-checkins at python.org
Fri Aug 7 07:15:30 CEST 2015


https://hg.python.org/cpython/rev/226d379b351e
changeset:   97314:226d379b351e
user:        Raymond Hettinger <python at rcn.com>
date:        Thu Aug 06 22:15:22 2015 -0700
summary:
  Restore frozenset hash caching removed in cf707dd190a9

files:
  Objects/setobject.c |  3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Objects/setobject.c b/Objects/setobject.c
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -763,6 +763,9 @@
     Py_uhash_t hash = 1927868237UL;
     setentry *entry;
 
+    if (so->hash != -1)
+        return so->hash;
+
     /* Initial dispersion based on the number of active entries */
     hash *= (Py_uhash_t)PySet_GET_SIZE(self) + 1;
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list