[Python-checkins] cpython (3.3): Change style to match the surrounding code (no early returns).

stefan.krah python-checkins at python.org
Fri Nov 8 21:14:21 CET 2013


http://hg.python.org/cpython/rev/88b85b53f067
changeset:   87017:88b85b53f067
branch:      3.3
user:        Stefan Krah <skrah at bytereef.org>
date:        Fri Nov 08 17:48:58 2013 +0100
summary:
  Change style to match the surrounding code (no early returns).

files:
  Modules/_decimal/_decimal.c |  7 +++----
  1 files changed, 3 insertions(+), 4 deletions(-)


diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3010,12 +3010,11 @@
         }
     }
     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);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list