Style/consistency nit: make math_floor and math_ceil code look the same.
This commit is contained in:
parent
9fc68c4e70
commit
6d02d9cc6b
@ -841,7 +841,7 @@ FUNC1(atanh, m_atanh, 0,
|
|||||||
|
|
||||||
static PyObject * math_ceil(PyObject *self, PyObject *number) {
|
static PyObject * math_ceil(PyObject *self, PyObject *number) {
|
||||||
static PyObject *ceil_str = NULL;
|
static PyObject *ceil_str = NULL;
|
||||||
PyObject *method;
|
PyObject *method, *result;
|
||||||
|
|
||||||
method = _PyObject_LookupSpecial(number, "__ceil__", &ceil_str);
|
method = _PyObject_LookupSpecial(number, "__ceil__", &ceil_str);
|
||||||
if (method == NULL) {
|
if (method == NULL) {
|
||||||
@ -849,11 +849,9 @@ static PyObject * math_ceil(PyObject *self, PyObject *number) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
return math_1_to_int(number, ceil, 0);
|
return math_1_to_int(number, ceil, 0);
|
||||||
}
|
}
|
||||||
else {
|
result = PyObject_CallFunctionObjArgs(method, NULL);
|
||||||
PyObject *result = PyObject_CallFunctionObjArgs(method, NULL);
|
|
||||||
Py_DECREF(method);
|
Py_DECREF(method);
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(math_ceil_doc,
|
PyDoc_STRVAR(math_ceil_doc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user