diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-10-31 12:38:42 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-10-31 12:38:42 (GMT) |
commit | b43ad1d569db4f5046371865ab9b5eb8f0541efa (patch) | |
tree | 12cbaf09bf506e52e7e9dd0b585db41a7519eaa3 /Modules/_pickle.c | |
parent | fa6ab0fa5b62043d62d45c7d8503bbce58a1684d (diff) | |
download | cpython-b43ad1d569db4f5046371865ab9b5eb8f0541efa.zip cpython-b43ad1d569db4f5046371865ab9b5eb8f0541efa.tar.gz cpython-b43ad1d569db4f5046371865ab9b5eb8f0541efa.tar.bz2 |
cleanup _Unpickler_SkipConsumed(): remove 1 level of indentation
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r-- | Modules/_pickle.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index f79fad3..f837264 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; } |