Convert another post-decrement while-loop to pre-decrement for consistency

and better generated code (on both GCC and CLang).
This commit is contained in:
Raymond Hettinger 2016-01-24 12:40:42 -08:00
parent 165eee214b
commit 306d6b1ea6
1 changed files with 2 additions and 1 deletions

View File

@ -895,7 +895,8 @@ deque_reverse(dequeobject *deque, PyObject *unused)
Py_ssize_t n = Py_SIZE(deque) >> 1;
PyObject *tmp;
while (n-- > 0) {
n++;
while (--n) {
/* Validate that pointers haven't met in the middle */
assert(leftblock != rightblock || leftindex < rightindex);
CHECK_NOT_END(leftblock);