[Python-checkins] cpython: Eliminate unnecessary variable

raymond.hettinger python-checkins at python.org
Tue Sep 22 10:20:44 CEST 2015


https://hg.python.org/cpython/rev/2ec2b11ed157
changeset:   98169:2ec2b11ed157
user:        Raymond Hettinger <python at rcn.com>
date:        Tue Sep 22 01:20:36 2015 -0700
summary:
  Eliminate unnecessary variable

files:
  Modules/_collectionsmodule.c |  3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -804,10 +804,9 @@
     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);

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list