scmutil: speed up new-style range extension
authorBryan O'Sullivan <bryano@fb.com>
Fri, 22 Jun 2012 12:00:41 -0700
changeset 17037 419966126a05
parent 17036 ab4644c3064f
child 17042 cd7db8e05c65
scmutil: speed up new-style range extension This improves perfrevset performance by 10% for 2222::33333 on a kernel repo.
mercurial/scmutil.py
--- 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