Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d02d9c

Browse files
committed
Style/consistency nit: make math_floor and math_ceil code look the same.
1 parent 9fc68c4 commit 6d02d9c

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

Modules/mathmodule.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -841,19 +841,17 @@ FUNC1(atanh, m_atanh, 0,
841841

842842
static PyObject * math_ceil(PyObject *self, PyObject *number) {
843843
static PyObject *ceil_str = NULL;
844-
PyObject *method;
844+
PyObject *method, *result;
845845

846846
method = _PyObject_LookupSpecial(number, "__ceil__", &ceil_str);
847847
if (method == NULL) {
848848
if (PyErr_Occurred())
849849
return NULL;
850850
return math_1_to_int(number, ceil, 0);
851851
}
852-
else {
853-
PyObject *result = PyObject_CallFunctionObjArgs(method, NULL);
854-
Py_DECREF(method);
855-
return result;
856-
}
852+
result = PyObject_CallFunctionObjArgs(method, NULL);
853+
Py_DECREF(method);
854+
return result;
857855
}
858856

859857
PyDoc_STRVAR(math_ceil_doc,

0 commit comments

Comments
 (0)