Kaydet (Commit) 306d6b1e authored tarafından Raymond Hettinger's avatar Raymond Hettinger

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

and better generated code (on both GCC and CLang).
üst 165eee21
...@@ -895,7 +895,8 @@ deque_reverse(dequeobject *deque, PyObject *unused) ...@@ -895,7 +895,8 @@ deque_reverse(dequeobject *deque, PyObject *unused)
Py_ssize_t n = Py_SIZE(deque) >> 1; Py_ssize_t n = Py_SIZE(deque) >> 1;
PyObject *tmp; PyObject *tmp;
while (n-- > 0) { n++;
while (--n) {
/* Validate that pointers haven't met in the middle */ /* Validate that pointers haven't met in the middle */
assert(leftblock != rightblock || leftindex < rightindex); assert(leftblock != rightblock || leftindex < rightindex);
CHECK_NOT_END(leftblock); CHECK_NOT_END(leftblock);
......
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