From: Raymond Hettinger Date: Wed, 2 Mar 2016 08:06:21 +0000 (-0800) Subject: Put block length computations in a more logical order. X-Git-Tag: v3.6.0a1~545 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=589106b20683b95aac1fe29cf9db5aed632f1cf3;p=thirdparty%2FPython%2Fcpython.git Put block length computations in a more logical order. --- diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 0b7a88f9749d..309dfd26a972 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);