# HG changeset patch # User Siddharth Agarwal # Date 1364939450 25200 # Node ID 835e9dfd1e492b77339aec92d1690b4462d5782d # Parent 887b75fda1695b2690220913e8ffd0a362aaec18 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. diff -r 887b75fda169 -r 835e9dfd1e49 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)