mirror of https://github.com/python/cpython
Convert two other post-decrement while-loops to pre-decrements for consistency
and for better code generation.
This commit is contained in:
parent
d84ec225bd
commit
165eee214b
|
@ -937,7 +937,8 @@ deque_count(dequeobject *deque, PyObject *v)
|
||||||
PyObject *item;
|
PyObject *item;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
while (n--) {
|
n++;
|
||||||
|
while (--n) {
|
||||||
CHECK_NOT_END(b);
|
CHECK_NOT_END(b);
|
||||||
item = b->data[index];
|
item = b->data[index];
|
||||||
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
|
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
|
||||||
|
@ -974,7 +975,8 @@ deque_contains(dequeobject *deque, PyObject *v)
|
||||||
PyObject *item;
|
PyObject *item;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
while (n--) {
|
n++;
|
||||||
|
while (--n) {
|
||||||
CHECK_NOT_END(b);
|
CHECK_NOT_END(b);
|
||||||
item = b->data[index];
|
item = b->data[index];
|
||||||
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
|
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
|
||||||
|
|
Loading…
Reference in New Issue