Mercurial > hg
changeset 18714:7790d69af6d6
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.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 22 Feb 2013 10:05:22 -0800 |
parents | 8728579f6bdc |
children | 963468e9f9e5 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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)