# HG changeset patch # User Bryan O'Sullivan # Date 1361556322 28800 # Node ID 7790d69af6d6bd72b4d5495c6a75abdc75cbeb33 # Parent 8728579f6bdc794723dd452c704b96012c7fec20 localrepo: iterate over manifest key/value pairs in status This saves us a couple of dict lookups in the common case, and improves the performance of the status method by 5% (measured with util.timed) in a repo with a large manifest. diff -r 8728579f6bdc -r 7790d69af6d6 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Feb 21 12:55:39 2013 -0800 +++ b/mercurial/localrepo.py Fri Feb 22 10:05:22 2013 -0800 @@ -1532,12 +1532,12 @@ modified, added, clean = [], [], [] withflags = mf1.withflags() | mf2.withflags() - for fn in mf2: + for fn, mf2node in mf2.iteritems(): if fn in mf1: if (fn not in deleted and ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or - (mf1[fn] != mf2[fn] and - (mf2[fn] or ctx1[fn].cmp(ctx2[fn]))))): + (mf1[fn] != mf2node and + (mf2node or ctx1[fn].cmp(ctx2[fn]))))): modified.append(fn) elif listclean: clean.append(fn)