summaryrefslogtreecommitdiffstats
path: root/Modules/_collectionsmodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2013-07-07 03:49:06 (GMT)
committerRaymond Hettinger <python@rcn.com>2013-07-07 03:49:06 (GMT)
commitf3a67b7e57abc2085e4c62f7be2712943a84dedc (patch)
tree1339d33dc0d008e932b2574ce3b28940deda959c /Modules/_collectionsmodule.c
parentdf715ba54d6a5cad9f59bffe1c2180691a999450 (diff)
downloadcpython-f3a67b7e57abc2085e4c62f7be2712943a84dedc.zip
cpython-f3a67b7e57abc2085e4c62f7be2712943a84dedc.tar.gz
cpython-f3a67b7e57abc2085e4c62f7be2712943a84dedc.tar.bz2
Improve variable names in deque_count()
Diffstat (limited to 'Modules/_collectionsmodule.c')
-rw-r--r--Modules/_collectionsmodule.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 9e0d8f5..d407ff4 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -581,8 +581,8 @@ PyDoc_STRVAR(reverse_doc,
static PyObject *
deque_count(dequeobject *deque, PyObject *v)
{
- block *leftblock = deque->leftblock;
- Py_ssize_t leftindex = deque->leftindex;
+ 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;
@@ -591,8 +591,8 @@ deque_count(dequeobject *deque, PyObject *v)
int cmp;
for (i=0 ; i<n ; i++) {
- assert(leftblock != NULL);
- item = leftblock->data[leftindex];
+ assert(b != NULL);
+ item = b->data[index];
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
if (cmp > 0)
count++;
@@ -606,10 +606,10 @@ deque_count(dequeobject *deque, PyObject *v)
}
/* Advance left block/index pair */
- leftindex++;
- if (leftindex == BLOCKLEN) {
- leftblock = leftblock->rightlink;
- leftindex = 0;
+ index++;
+ if (index == BLOCKLEN) {
+ b = b->rightlink;
+ index = 0;
}
}
return PyLong_FromSsize_t(count);