From: Raymond Hettinger Date: Fri, 7 Aug 2015 05:15:22 +0000 (-0700) Subject: Restore frozenset hash caching removed in cf707dd190a9 X-Git-Tag: v3.6.0a1~1819 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b501a27ad8ec4b531a9c1057952d8f7c6ef8cb77;p=python Restore frozenset hash caching removed in cf707dd190a9 --- 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;