summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-09-23 09:42:02 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-09-23 09:42:02 (GMT)
commit3a1a8d04244cb5d98e8bbeaff131a705f84b8521 (patch)
treee0ff05456cd7f69d831b4c3350728bcfac31db53 /Modules
parent54afac325cb953be0b98717abd67d174770338ca (diff)
downloadcpython-3a1a8d04244cb5d98e8bbeaff131a705f84b8521.zip
cpython-3a1a8d04244cb5d98e8bbeaff131a705f84b8521.tar.gz
cpython-3a1a8d04244cb5d98e8bbeaff131a705f84b8521.tar.bz2
Eliminate unnecessary variables
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_collectionsmodule.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 4eb31bf..be6c90c 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -843,13 +843,12 @@ deque_count(dequeobject *deque, PyObject *v)
block *b = deque->leftblock;
Py_ssize_t index = deque->leftindex;
Py_ssize_t n = Py_SIZE(deque);
- Py_ssize_t i;
Py_ssize_t count = 0;
size_t start_state = deque->state;
PyObject *item;
int cmp;
- for (i=0 ; i<n ; i++) {
+ while (n--) {
CHECK_NOT_END(b);
item = b->data[index];
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
@@ -883,12 +882,11 @@ deque_contains(dequeobject *deque, PyObject *v)
block *b = deque->leftblock;
Py_ssize_t index = deque->leftindex;
Py_ssize_t n = Py_SIZE(deque);
- Py_ssize_t i;
size_t start_state = deque->state;
PyObject *item;
int cmp;
- for (i=0 ; i<n ; i++) {
+ while (n--) {
CHECK_NOT_END(b);
item = b->data[index];
cmp = PyObject_RichCompareBool(item, v, Py_EQ);