mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Cleanup dictobject.c
This commit is contained in:
parent
fdcbab9602
commit
a9f61a5a23
1 changed files with 18 additions and 16 deletions
|
@ -2589,11 +2589,14 @@ static PyObject *
|
|||
dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
PyObject *self;
|
||||
PyDictObject *d;
|
||||
|
||||
assert(type != NULL && type->tp_alloc != NULL);
|
||||
self = type->tp_alloc(type, 0);
|
||||
if (self != NULL) {
|
||||
PyDictObject *d = (PyDictObject *)self;
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
|
||||
d = (PyDictObject *)self;
|
||||
d->ma_keys = new_keys_object(PyDict_MINSIZE_COMBINED);
|
||||
/* XXX - Should we raise a no-memory error? */
|
||||
if (d->ma_keys == NULL) {
|
||||
|
@ -2605,7 +2608,6 @@ dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
/* The object has been implicitly tracked by tp_alloc */
|
||||
if (type == &PyDict_Type)
|
||||
_PyObject_GC_UNTRACK(d);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue