Mercurial > hg
changeset 17037:419966126a05
scmutil: speed up new-style range extension
This improves perfrevset performance by 10% for 2222::33333 on a
kernel repo.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 22 Jun 2012 12:00:41 -0700 |
parents | ab4644c3064f |
children | cd7db8e05c65 |
files | mercurial/scmutil.py |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/scmutil.py Tue Jun 26 14:32:20 2012 +0200 +++ b/mercurial/scmutil.py Fri Jun 22 12:00:41 2012 -0700 @@ -584,10 +584,9 @@ # fall through to new-style queries if old-style fails m = revset.match(repo.ui, spec) - for r in m(repo, range(len(repo))): - if r not in seen: - l.append(r) - seen.update(l) + dl = [r for r in m(repo, xrange(len(repo))) if r not in seen] + l.extend(dl) + seen.update(dl) return l