summaryrefslogtreecommitdiff
path: root/Modules/_collectionsmodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-03-02 00:06:21 -0800
committerRaymond Hettinger <python@rcn.com>2016-03-02 00:06:21 -0800
commita49619aa51ea57bb08b98eec185f0e8cb8f9bfd2 (patch)
treeac6aeb6cd0abafd68f22be726ed7af2fd3f85f15 /Modules/_collectionsmodule.c
parentd1338f71b177d5b2d5d56b18c4b940f2643abe61 (diff)
downloadcpython-a49619aa51ea57bb08b98eec185f0e8cb8f9bfd2.tar.gz
Put block length computations in a more logical order.
Diffstat (limited to 'Modules/_collectionsmodule.c')
-rw-r--r--Modules/_collectionsmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 0b7a88f974..309dfd26a9 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -589,8 +589,8 @@ deque_clear(dequeobject *deque)
/* Now the old size, leftblock, and leftindex are disconnected from
the empty deque and we can use them to decref the pointers.
*/
- itemptr = &leftblock->data[leftindex];
m = (BLOCKLEN - leftindex > n) ? n : BLOCKLEN - leftindex;
+ itemptr = &leftblock->data[leftindex];
limit = &leftblock->data[leftindex + m];
n -= m;
while (1) {
@@ -600,8 +600,8 @@ deque_clear(dequeobject *deque)
CHECK_NOT_END(leftblock->rightlink);
prevblock = leftblock;
leftblock = leftblock->rightlink;
- itemptr = leftblock->data;
m = (n > BLOCKLEN) ? BLOCKLEN : n;
+ itemptr = leftblock->data;
limit = &leftblock->data[m];
n -= m;
freeblock(prevblock);