mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Issue 23261: Clean-up the hack to store the set.pop() search finger in a hash field instead of the setobject.
This commit is contained in:
parent
a556af77a7
commit
1202a4733e
3 changed files with 15 additions and 25 deletions
|
|
@ -14,9 +14,7 @@ extern "C" {
|
|||
2. Active: key != NULL and key != dummy
|
||||
3. Dummy: key == dummy
|
||||
|
||||
Note: .pop() abuses the hash field of an Unused or Dummy slot to
|
||||
hold a search finger. The hash field of Unused or Dummy slots has
|
||||
no meaning otherwise.
|
||||
The hash field of Unused or Dummy slots have no meaning.
|
||||
*/
|
||||
|
||||
#define PySet_MINSIZE 8
|
||||
|
|
@ -59,6 +57,7 @@ typedef struct _setobject {
|
|||
Py_hash_t hash; /* Only used by frozenset objects */
|
||||
setentry smalltable[PySet_MINSIZE];
|
||||
|
||||
Py_ssize_t finger; /* Search finger for pop() */
|
||||
PyObject *weakreflist; /* List of weak references */
|
||||
} PySetObject;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue