diff mercurial/ignore.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 04c76f296ad6
children 46293a0c7e9f
line wrap: on
line diff
--- a/mercurial/ignore.py	Mon Jan 12 09:07:02 2009 +0100
+++ b/mercurial/ignore.py	Mon Jan 12 09:16:03 2009 +0100
@@ -60,7 +60,7 @@
                         warn(_("%s: ignoring invalid syntax '%s'\n") % (f, s))
                     continue
                 pat = syntax + line
-                for s, rels in syntaxes.items():
+                for s, rels in syntaxes.iteritems():
                     if line.startswith(rels):
                         pat = line
                         break
@@ -83,7 +83,7 @@
             util.matcher(root, inc=allpats, src='.hgignore'))
     except util.Abort:
         # Re-raise an exception where the src is the right file
-        for f, patlist in pats.items():
+        for f, patlist in pats.iteritems():
             files, ignorefunc, anypats = (
                 util.matcher(root, inc=patlist, src=f))