mirror of
https://github.com/python/cpython.git
synced 2025-12-09 02:35:14 +00:00
Restore frozenset hash caching removed in cf707dd190a9
This commit is contained in:
parent
8e9f9852be
commit
b501a27ad8
1 changed files with 3 additions and 0 deletions
|
|
@ -763,6 +763,9 @@ frozenset_hash(PyObject *self)
|
||||||
Py_uhash_t hash = 1927868237UL;
|
Py_uhash_t hash = 1927868237UL;
|
||||||
setentry *entry;
|
setentry *entry;
|
||||||
|
|
||||||
|
if (so->hash != -1)
|
||||||
|
return so->hash;
|
||||||
|
|
||||||
/* Initial dispersion based on the number of active entries */
|
/* Initial dispersion based on the number of active entries */
|
||||||
hash *= (Py_uhash_t)PySet_GET_SIZE(self) + 1;
|
hash *= (Py_uhash_t)PySet_GET_SIZE(self) + 1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue