Skip to content

Commit db8f5f2

Browse files
committed
address review: reformat s_new()
1 parent f7492ec commit db8f5f2

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Modules/_struct.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,17 +1799,18 @@ s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
17991799
allocfunc alloc_func = PyType_GetSlot(type, Py_tp_alloc);
18001800
assert(alloc_func != NULL);
18011801
self = (PyStructObject *)alloc_func(type, 0);
1802-
if (self != NULL) {
1803-
self->s_format = Py_NewRef(Py_None);
1804-
self->s_codes = NULL;
1805-
self->s_size = -1;
1806-
self->s_len = -1;
1807-
self->init_called = false;
1808-
if (PyTuple_GET_SIZE(args) > 0) {
1809-
if (actual___init___impl(self, PyTuple_GET_ITEM(args, 0))) {
1810-
Py_DECREF(self);
1811-
return NULL;
1812-
}
1802+
if (self == NULL) {
1803+
return NULL;
1804+
}
1805+
self->s_format = Py_NewRef(Py_None);
1806+
self->s_codes = NULL;
1807+
self->s_size = -1;
1808+
self->s_len = -1;
1809+
self->init_called = false;
1810+
if (PyTuple_GET_SIZE(args) > 0) {
1811+
if (actual___init___impl(self, PyTuple_GET_ITEM(args, 0))) {
1812+
Py_DECREF(self);
1813+
return NULL;
18131814
}
18141815
}
18151816
return (PyObject *)self;

0 commit comments

Comments
 (0)