diff mercurial/patch.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
parents f9a80054dd3c
children 0289f384e1e5
line wrap: on
line diff
--- a/mercurial/patch.py	Tue May 26 22:37:26 2009 +0200
+++ b/mercurial/patch.py	Tue May 26 22:59:52 2009 +0200
@@ -307,8 +307,7 @@
 
     def hashlines(self):
         self.hash = {}
-        for x in xrange(len(self.lines)):
-            s = self.lines[x]
+        for x, s in enumerate(self.lines):
             self.hash.setdefault(s, []).append(x)
 
     def write_rej(self):