summaryrefslogtreecommitdiff
path: root/Modules/_decimal
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2013-11-08 17:48:58 +0100
committerStefan Krah <skrah@bytereef.org>2013-11-08 17:48:58 +0100
commit954d6cf4022abb98d130106d041e713675e9ba08 (patch)
tree9ef16ec05ea28a06d6e3b8feeb8211b296fd58a0 /Modules/_decimal
parent71e3761f66e6aee8dcee21d06baf6079eeeac805 (diff)
downloadcpython-954d6cf4022abb98d130106d041e713675e9ba08.tar.gz
Change style to match the surrounding code (no early returns).
Diffstat (limited to 'Modules/_decimal')
-rw-r--r--Modules/_decimal/_decimal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index 6f9e9def47..aec3949c79 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3010,12 +3010,11 @@ convert_op_cmp(PyObject **vcmp, PyObject **wcmp, PyObject *v, PyObject *w,
}
}
else {
- int is_instance = PyObject_IsInstance(w, Rational);
- if (is_instance < 0) {
+ int is_rational = PyObject_IsInstance(w, Rational);
+ if (is_rational < 0) {
*wcmp = NULL;
- return 0;
}
- if (is_instance) {
+ else if (is_rational > 0) {
*wcmp = numerator_as_decimal(w, context);
if (*wcmp && !mpd_isspecial(MPD(v))) {
*vcmp = multiply_by_denominator(v, w, context);