diff options
author | Raymond Hettinger <python@rcn.com> | 2013-07-21 08:51:07 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-07-21 08:51:07 (GMT) |
commit | b97cc49c3a4870713f1872de87543651dc940e96 (patch) | |
tree | 8cad214884a58f2053e8856305ef75bf813f426f /Modules | |
parent | 02e8b53e6da8b89466b87eaf2f1f8ee027962cbe (diff) | |
download | cpython-b97cc49c3a4870713f1872de87543651dc940e96.zip cpython-b97cc49c3a4870713f1872de87543651dc940e96.tar.gz cpython-b97cc49c3a4870713f1872de87543651dc940e96.tar.bz2 |
Minor code simplification by eliminating an unnecessary temporary variable.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_collectionsmodule.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 5d5fc91..3ff1d1f 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -491,7 +491,6 @@ _deque_rotate(dequeobject *deque, Py_ssize_t n) b = NULL; } assert(leftindex > 0); - { PyObject **src, **dest; Py_ssize_t m = n; @@ -510,15 +509,13 @@ _deque_rotate(dequeobject *deque, Py_ssize_t n) *(dest--) = *(src--); } while (--m); } - if (rightindex == -1) { - block *prevblock = rightblock->leftlink; assert(leftblock != rightblock); assert(b == NULL); b = rightblock; - CHECK_NOT_END(prevblock); - MARK_END(prevblock->rightlink); - rightblock = prevblock; + CHECK_NOT_END(rightblock->leftlink); + rightblock = rightblock->leftlink; + MARK_END(rightblock->rightlink); rightindex = BLOCKLEN - 1; } } @@ -538,7 +535,6 @@ _deque_rotate(dequeobject *deque, Py_ssize_t n) b = NULL; } assert (rightindex < BLOCKLEN - 1); - { PyObject **src, **dest; Py_ssize_t m = -n; @@ -557,15 +553,13 @@ _deque_rotate(dequeobject *deque, Py_ssize_t n) *(dest++) = *(src++); } while (--m); } - if (leftindex == BLOCKLEN) { - block *nextblock = leftblock->rightlink; assert(leftblock != rightblock); assert(b == NULL); b = leftblock; - CHECK_NOT_END(nextblock); - MARK_END(nextblock->leftlink); - leftblock = nextblock; + CHECK_NOT_END(leftblock->rightlink); + leftblock = leftblock->rightlink; + MARK_END(leftblock->leftlink); leftindex = 0; } } |