summaryrefslogtreecommitdiff
path: root/Objects/setobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-08-06 22:15:22 -0700
committerRaymond Hettinger <python@rcn.com>2015-08-06 22:15:22 -0700
commitb501a27ad8ec4b531a9c1057952d8f7c6ef8cb77 (patch)
treea6f91d7786d47fe52286239560a7622a54ec83bf /Objects/setobject.c
parent8e9f9852bea430a07af8e33abb1f1b2501e3e3ec (diff)
downloadcpython-git-b501a27ad8ec4b531a9c1057952d8f7c6ef8cb77.tar.gz
Restore frozenset hash caching removed in cf707dd190a9
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r--Objects/setobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 24424ad8b9..0a065cc27d 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -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;