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:
Raymond Hettinger 2015-01-18 13:12:42 -08:00
parent a556af77a7
commit 1202a4733e
3 changed files with 15 additions and 25 deletions

View file

@ -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;