]> granicus.if.org Git - python/commitdiff
Eliminate unnecessary variable
authorRaymond Hettinger <python@rcn.com>
Tue, 22 Sep 2015 08:20:36 +0000 (01:20 -0700)
committerRaymond Hettinger <python@rcn.com>
Tue, 22 Sep 2015 08:20:36 +0000 (01:20 -0700)
Modules/_collectionsmodule.c

index 7dbf7555d4987d55c910bd2a93543434e1b32490..4eb31bf9c543fae5778370f04b2e26b7a036da75 100644 (file)
@@ -804,10 +804,9 @@ deque_reverse(dequeobject *deque, PyObject *unused)
     Py_ssize_t leftindex = deque->leftindex;
     Py_ssize_t rightindex = deque->rightindex;
     Py_ssize_t n = Py_SIZE(deque) >> 1;
-    Py_ssize_t i;
     PyObject *tmp;
 
-    for (i=0 ; i<n ; i++) {
+    while (n-- > 0) {
         /* Validate that pointers haven't met in the middle */
         assert(leftblock != rightblock || leftindex < rightindex);
         CHECK_NOT_END(leftblock);