From: Victor Stinner Date: Thu, 31 Oct 2013 12:38:42 +0000 (+0100) Subject: cleanup _Unpickler_SkipConsumed(): remove 1 level of indentation X-Git-Tag: v3.4.0b1~457 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b43ad1d569db4f5046371865ab9b5eb8f0541efa;p=thirdparty%2FPython%2Fcpython.git cleanup _Unpickler_SkipConsumed(): remove 1 level of indentation --- diff --git a/Modules/_pickle.c b/Modules/_pickle.c index f79fad3c391d..f837264cae12 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -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; }