Kaydet (Commit) b43ad1d5 authored tarafından Victor Stinner's avatar Victor Stinner

cleanup _Unpickler_SkipConsumed(): remove 1 level of indentation

üst fa6ab0fa
......@@ -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) {
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment