diff options
author | Raymond Hettinger <python@rcn.com> | 2016-03-02 08:30:58 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-03-02 08:30:58 (GMT) |
commit | 6f86a3308a089e80be2562316dec142d65c85451 (patch) | |
tree | bdd1c4005c0853d3ca481e51754318764b2581dd /Modules | |
parent | 589106b20683b95aac1fe29cf9db5aed632f1cf3 (diff) | |
download | cpython-6f86a3308a089e80be2562316dec142d65c85451.zip cpython-6f86a3308a089e80be2562316dec142d65c85451.tar.gz cpython-6f86a3308a089e80be2562316dec142d65c85451.tar.bz2 |
Factor-out common subexpression.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_collectionsmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 309dfd2..7dcd7e7 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -572,9 +572,9 @@ deque_clear(dequeobject *deque) } /* Remember the old size, leftblock, and leftindex */ + n = Py_SIZE(deque); leftblock = deque->leftblock; leftindex = deque->leftindex; - n = Py_SIZE(deque); /* Set the deque to be empty using the newly allocated block */ MARK_END(b->leftlink); @@ -591,7 +591,7 @@ deque_clear(dequeobject *deque) */ m = (BLOCKLEN - leftindex > n) ? n : BLOCKLEN - leftindex; itemptr = &leftblock->data[leftindex]; - limit = &leftblock->data[leftindex + m]; + limit = itemptr + m; n -= m; while (1) { if (itemptr == limit) { @@ -602,7 +602,7 @@ deque_clear(dequeobject *deque) leftblock = leftblock->rightlink; m = (n > BLOCKLEN) ? BLOCKLEN : n; itemptr = leftblock->data; - limit = &leftblock->data[m]; + limit = itemptr + m; n -= m; freeblock(prevblock); } |