mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
* Improve code for the empty frozenset singleton:
- Handle both frozenset() and frozenset([]). - Do not use singleton for frozenset subclasses. - Finalize the singleton. - Add test cases. * Factor-out set_update_internal() from set_update(). Simplifies the code for several internal callers. * Factor constant expressions out of loop in set_merge_internal(). * Minor comment touch-ups.
This commit is contained in:
parent
e295676c87
commit
d794666048
5 changed files with 89 additions and 65 deletions
|
@ -115,6 +115,7 @@ PyAPI_FUNC(void) PyFrame_Fini(void);
|
|||
PyAPI_FUNC(void) PyCFunction_Fini(void);
|
||||
PyAPI_FUNC(void) PyTuple_Fini(void);
|
||||
PyAPI_FUNC(void) PyList_Fini(void);
|
||||
PyAPI_FUNC(void) PySet_Fini(void);
|
||||
PyAPI_FUNC(void) PyString_Fini(void);
|
||||
PyAPI_FUNC(void) PyInt_Fini(void);
|
||||
PyAPI_FUNC(void) PyFloat_Fini(void);
|
||||
|
|
|
@ -42,8 +42,7 @@ struct _setobject {
|
|||
|
||||
/* table points to smalltable for small tables, else to
|
||||
* additional malloc'ed memory. table is never NULL! This rule
|
||||
* saves repeated runtime null-tests in the workhorse getitem and
|
||||
* setitem calls.
|
||||
* saves repeated runtime null-tests.
|
||||
*/
|
||||
setentry *table;
|
||||
setentry *(*lookup)(PySetObject *so, PyObject *key, long hash);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue