Kaydet (Commit) 589106b2 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Put block length computations in a more logical order.

üst 2ad474ba
...@@ -589,8 +589,8 @@ deque_clear(dequeobject *deque) ...@@ -589,8 +589,8 @@ deque_clear(dequeobject *deque)
/* Now the old size, leftblock, and leftindex are disconnected from /* Now the old size, leftblock, and leftindex are disconnected from
the empty deque and we can use them to decref the pointers. the empty deque and we can use them to decref the pointers.
*/ */
itemptr = &leftblock->data[leftindex];
m = (BLOCKLEN - leftindex > n) ? n : BLOCKLEN - leftindex; m = (BLOCKLEN - leftindex > n) ? n : BLOCKLEN - leftindex;
itemptr = &leftblock->data[leftindex];
limit = &leftblock->data[leftindex + m]; limit = &leftblock->data[leftindex + m];
n -= m; n -= m;
while (1) { while (1) {
...@@ -600,8 +600,8 @@ deque_clear(dequeobject *deque) ...@@ -600,8 +600,8 @@ deque_clear(dequeobject *deque)
CHECK_NOT_END(leftblock->rightlink); CHECK_NOT_END(leftblock->rightlink);
prevblock = leftblock; prevblock = leftblock;
leftblock = leftblock->rightlink; leftblock = leftblock->rightlink;
itemptr = leftblock->data;
m = (n > BLOCKLEN) ? BLOCKLEN : n; m = (n > BLOCKLEN) ? BLOCKLEN : n;
itemptr = leftblock->data;
limit = &leftblock->data[m]; limit = &leftblock->data[m];
n -= m; n -= m;
freeblock(prevblock); freeblock(prevblock);
......
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