Commit 165eee21 authored by Raymond Hettinger's avatar Raymond Hettinger

Convert two other post-decrement while-loops to pre-decrements for consistency

and for better code generation.
parent d84ec225
......@@ -937,7 +937,8 @@ deque_count(dequeobject *deque, PyObject *v)
PyObject *item;
int cmp;
while (n--) {
n++;
while (--n) {
CHECK_NOT_END(b);
item = b->data[index];
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
......@@ -974,7 +975,8 @@ deque_contains(dequeobject *deque, PyObject *v)
PyObject *item;
int cmp;
while (n--) {
n++;
while (--n) {
CHECK_NOT_END(b);
item = b->data[index];
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
......
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