]> granicus.if.org Git - python/commitdiff
Restore frozenset hash caching removed in cf707dd190a9
authorRaymond Hettinger <python@rcn.com>
Fri, 7 Aug 2015 05:15:22 +0000 (22:15 -0700)
committerRaymond Hettinger <python@rcn.com>
Fri, 7 Aug 2015 05:15:22 +0000 (22:15 -0700)
Objects/setobject.c

index 24424ad8b982643d60569e80c312d7b67940e9f8..0a065cc27ddc27697f2949a48f5995e2b513dd0f 100644 (file)
@@ -763,6 +763,9 @@ frozenset_hash(PyObject *self)
     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;