diff mercurial/mdiff.py @ 8632:9e055cfdd620

replace "i in range(len(xs))" with "i, x in enumerate(xs)" The remaining occurrences should be the ones where "xs" is mutated or where "i" is used for index arithmetic.
author Martin Geisler <mg@lazybytes.net>
date Tue, 26 May 2009 22:59:52 +0200 (2009-05-26)
parents b87a50b7125c
children 4fe9ca519637
line wrap: on
line diff
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -185,7 +185,7 @@
     #
     diff = bdiff.blocks(t1, t2)
     hunk = None
-    for i in xrange(len(diff)):
+    for i, s1 in enumerate(diff):
         # The first match is special.
         # we've either found a match starting at line 0 or a match later
         # in the file.  If it starts later, old and new below will both be
@@ -195,7 +195,6 @@
         else:
             s = [0, 0, 0, 0]
         delta = []
-        s1 = diff[i]
         a1 = s[1]
         a2 = s1[0]
         b1 = s[3]