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

Skip to content

Commit 5ec6be9

Browse files
author
Stefan Krah
committed
Change style to match the surrounding code (no early returns).
1 parent 70e11ac commit 5ec6be9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Modules/_decimal/_decimal.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,12 +3010,11 @@ convert_op_cmp(PyObject **vcmp, PyObject **wcmp, PyObject *v, PyObject *w,
30103010
}
30113011
}
30123012
else {
3013-
int is_instance = PyObject_IsInstance(w, Rational);
3014-
if (is_instance < 0) {
3013+
int is_rational = PyObject_IsInstance(w, Rational);
3014+
if (is_rational < 0) {
30153015
*wcmp = NULL;
3016-
return 0;
30173016
}
3018-
if (is_instance) {
3017+
else if (is_rational > 0) {
30193018
*wcmp = numerator_as_decimal(w, context);
30203019
if (*wcmp && !mpd_isspecial(MPD(v))) {
30213020
*vcmp = multiply_by_denominator(v, w, context);

0 commit comments

Comments
 (0)