diff mercurial/hgweb/webcommands.py @ 7622:4dd7b28003d2

use dict.iteritems() rather than dict.items() This should be faster and more future-proof. Calls where the result is to be sorted using util.sort() have been left unchanged. Calls to .items() on configparser objects have been left as-is, too.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Mon, 12 Jan 2009 09:16:03 +0100
parents 069b29656401
children 08cabecfa8a8
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Mon Jan 12 09:07:02 2009 +0100
+++ b/mercurial/hgweb/webcommands.py	Mon Jan 12 09:16:03 2009 +0100
@@ -275,7 +275,7 @@
     l = len(path)
     abspath = "/" + path
 
-    for f, n in mf.items():
+    for f, n in mf.iteritems():
         if f[:l] != path:
             continue
         remain = f[l:]
@@ -386,7 +386,7 @@
         parity = paritygen(web.stripecount)
 
         b = web.repo.branchtags()
-        l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.items()]
+        l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.iteritems()]
         for r,n,t in util.sort(l):
             yield {'parity': parity.next(),
                    'branch': t,