mirror of https://github.com/python/cpython
Neaten-up the inner-loop logic.
This commit is contained in:
parent
9ce52e3bda
commit
4a91d21381
|
@ -1053,13 +1053,13 @@ deque_index(dequeobject *deque, PyObject *args)
|
|||
}
|
||||
}
|
||||
|
||||
n = stop - i;
|
||||
while (n--) {
|
||||
n = stop - i + 1;
|
||||
while (--n) {
|
||||
CHECK_NOT_END(b);
|
||||
item = b->data[index];
|
||||
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
|
||||
if (cmp > 0)
|
||||
return PyLong_FromSsize_t(stop - (n + 1));
|
||||
return PyLong_FromSsize_t(stop - n);
|
||||
if (cmp < 0)
|
||||
return NULL;
|
||||
if (start_state != deque->state) {
|
||||
|
|
Loading…
Reference in New Issue