mirror of https://github.com/python/cpython.git
Improve variable names in deque_count()
This commit is contained in:
parent
df715ba54d
commit
f3a67b7e57
|
@ -581,8 +581,8 @@ PyDoc_STRVAR(reverse_doc,
|
||||||
static PyObject *
|
static PyObject *
|
||||||
deque_count(dequeobject *deque, PyObject *v)
|
deque_count(dequeobject *deque, PyObject *v)
|
||||||
{
|
{
|
||||||
block *leftblock = deque->leftblock;
|
block *b = deque->leftblock;
|
||||||
Py_ssize_t leftindex = deque->leftindex;
|
Py_ssize_t index = deque->leftindex;
|
||||||
Py_ssize_t n = Py_SIZE(deque);
|
Py_ssize_t n = Py_SIZE(deque);
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
Py_ssize_t count = 0;
|
Py_ssize_t count = 0;
|
||||||
|
@ -591,8 +591,8 @@ deque_count(dequeobject *deque, PyObject *v)
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
for (i=0 ; i<n ; i++) {
|
for (i=0 ; i<n ; i++) {
|
||||||
assert(leftblock != NULL);
|
assert(b != NULL);
|
||||||
item = leftblock->data[leftindex];
|
item = b->data[index];
|
||||||
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
|
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
|
||||||
if (cmp > 0)
|
if (cmp > 0)
|
||||||
count++;
|
count++;
|
||||||
|
@ -606,10 +606,10 @@ deque_count(dequeobject *deque, PyObject *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advance left block/index pair */
|
/* Advance left block/index pair */
|
||||||
leftindex++;
|
index++;
|
||||||
if (leftindex == BLOCKLEN) {
|
if (index == BLOCKLEN) {
|
||||||
leftblock = leftblock->rightlink;
|
b = b->rightlink;
|
||||||
leftindex = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PyLong_FromSsize_t(count);
|
return PyLong_FromSsize_t(count);
|
||||||
|
|
Loading…
Reference in New Issue