cleanup _Unpickler_SkipConsumed(): remove 1 level of indentation
This commit is contained in:
parent
fa6ab0fa5b
commit
b43ad1d569
|
@ -872,18 +872,21 @@ _Unpickler_SetStringInput(UnpicklerObject *self, PyObject *input)
|
||||||
static int
|
static int
|
||||||
_Unpickler_SkipConsumed(UnpicklerObject *self)
|
_Unpickler_SkipConsumed(UnpicklerObject *self)
|
||||||
{
|
{
|
||||||
Py_ssize_t consumed = self->next_read_idx - self->prefetched_idx;
|
Py_ssize_t consumed;
|
||||||
|
PyObject *r;
|
||||||
|
|
||||||
if (consumed > 0) {
|
consumed = self->next_read_idx - self->prefetched_idx;
|
||||||
PyObject *r;
|
if (consumed <= 0)
|
||||||
assert(self->peek); /* otherwise we did something wrong */
|
return 0;
|
||||||
/* This makes an useless copy... */
|
|
||||||
r = PyObject_CallFunction(self->read, "n", consumed);
|
assert(self->peek); /* otherwise we did something wrong */
|
||||||
if (r == NULL)
|
/* This makes an useless copy... */
|
||||||
return -1;
|
r = PyObject_CallFunction(self->read, "n", consumed);
|
||||||
Py_DECREF(r);
|
if (r == NULL)
|
||||||
self->prefetched_idx = self->next_read_idx;
|
return -1;
|
||||||
}
|
Py_DECREF(r);
|
||||||
|
|
||||||
|
self->prefetched_idx = self->next_read_idx;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue