]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
cleanup _Unpickler_SkipConsumed(): remove 1 level of indentation
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 31 Oct 2013 12:38:42 +0000 (13:38 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 31 Oct 2013 12:38:42 +0000 (13:38 +0100)
Modules/_pickle.c

index f79fad3c391de81c6e1b86977f641d94120c790f..f837264cae1286fb447299554872252893d9b452 100644 (file)
@@ -872,18 +872,21 @@ _Unpickler_SetStringInput(UnpicklerObject *self, PyObject *input)
 static int
 _Unpickler_SkipConsumed(UnpicklerObject *self)
 {
-    Py_ssize_t consumed = self->next_read_idx - self->prefetched_idx;
-
-    if (consumed > 0) {
-        PyObject *r;
-        assert(self->peek);  /* otherwise we did something wrong */
-        /* This makes an useless copy... */
-        r = PyObject_CallFunction(self->read, "n", consumed);
-        if (r == NULL)
-            return -1;
-        Py_DECREF(r);
-        self->prefetched_idx = self->next_read_idx;
-    }
+    Py_ssize_t consumed;
+    PyObject *r;
+
+    consumed = self->next_read_idx - self->prefetched_idx;
+    if (consumed <= 0)
+        return 0;
+
+    assert(self->peek);  /* otherwise we did something wrong */
+    /* This makes an useless copy... */
+    r = PyObject_CallFunction(self->read, "n", consumed);
+    if (r == NULL)
+        return -1;
+    Py_DECREF(r);
+
+    self->prefetched_idx = self->next_read_idx;
     return 0;
 }