util: simplify range expression
authorMartin Geisler <mg@lazybytes.net>
Tue, 26 May 2009 22:37:26 +0200
changeset 8631 a87c41f65aff
parent 8630 8ff65f7e3273
child 8632 9e055cfdd620
util: simplify range expression The n index variable was unused. Every iteration would pop one element off of parts, so the for loop can be replaced with a while loop.
mercurial/util.py
--- a/mercurial/util.py	Tue May 26 22:09:39 2009 +0200
+++ b/mercurial/util.py	Tue May 26 22:37:26 2009 +0200
@@ -512,7 +512,7 @@
                                 (path, prefix))
         parts.pop()
         prefixes = []
-        for n in range(len(parts)):
+        while parts:
             prefix = os.sep.join(parts)
             if prefix in self.auditeddir:
                 break