scmutil.addremove: use iteritems on walk results
authorSiddharth Agarwal <sid0@fb.com>
Tue, 02 Apr 2013 14:50:50 -0700
changeset 18865 835e9dfd1e49
parent 18864 887b75fda169
child 18867 c7e8b143e086
scmutil.addremove: use iteritems on walk results Now that we no longer sort all the walk results, using iteritems becomes possible. This is a relatively minor speedup: on a large repository with 170,000 files, perfaddremove goes from 2.13 seconds to 2.10.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Tue Apr 02 14:50:31 2013 -0700
+++ b/mercurial/scmutil.py	Tue Apr 02 14:50:50 2013 -0700
@@ -678,8 +678,7 @@
     ctx = repo[None]
     dirstate = repo.dirstate
     walkresults = dirstate.walk(m, sorted(ctx.substate), True, False)
-    for abs in walkresults:
-        st = walkresults[abs]
+    for abs, st in walkresults.iteritems():
         dstate = dirstate[abs]
         if dstate == '?' and audit_path.check(abs):
             unknown.append(abs)