tests: don't reimplement enumerate() in run-tests
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 02 Jul 2018 00:02:31 -0700
changeset 38550 296648321710
parent 38549 88e6630dc8d0
child 38551 174484b2528d
tests: don't reimplement enumerate() in run-tests Differential Revision: https://phab.mercurial-scm.org/D3877
tests/run-tests.py
--- a/tests/run-tests.py	Thu Jul 05 09:47:11 2018 +0530
+++ b/tests/run-tests.py	Mon Jul 02 00:02:31 2018 -0700
@@ -1480,10 +1480,8 @@
                 if expected.get(pos, None):
                     els = expected[pos]
 
-                i = 0
                 optional = []
-                while i < len(els):
-                    el = els[i]
+                for i, el in enumerate(els):
 
                     r = self.linematch(el, lout)
                     if isinstance(r, str):
@@ -1512,8 +1510,6 @@
                                 if not self._iftest(conditions):
                                     optional.append(i)
 
-                    i += 1
-
                 if r:
                     if r == "retry":
                         continue