Commit 51028956 authored by Victor Stinner's avatar Victor Stinner

Cleanup dictobject.c

parent 212922a0
...@@ -2589,11 +2589,14 @@ static PyObject * ...@@ -2589,11 +2589,14 @@ static PyObject *
dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds) dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *self; PyObject *self;
PyDictObject *d;
assert(type != NULL && type->tp_alloc != NULL); assert(type != NULL && type->tp_alloc != NULL);
self = type->tp_alloc(type, 0); self = type->tp_alloc(type, 0);
if (self != NULL) { if (self == NULL)
PyDictObject *d = (PyDictObject *)self; return NULL;
d = (PyDictObject *)self;
d->ma_keys = new_keys_object(PyDict_MINSIZE_COMBINED); d->ma_keys = new_keys_object(PyDict_MINSIZE_COMBINED);
/* XXX - Should we raise a no-memory error? */ /* XXX - Should we raise a no-memory error? */
if (d->ma_keys == NULL) { if (d->ma_keys == NULL) {
...@@ -2605,7 +2608,6 @@ dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -2605,7 +2608,6 @@ dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
/* The object has been implicitly tracked by tp_alloc */ /* The object has been implicitly tracked by tp_alloc */
if (type == &PyDict_Type) if (type == &PyDict_Type)
_PyObject_GC_UNTRACK(d); _PyObject_GC_UNTRACK(d);
}
return self; return self;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment