changeset 17786:72c234081ae1

branchpoint: remove useless intermediate set creation We don't need to compute the set of all branchpoints. We can just check the number of children that element of subset have. The extra work did not seems to had particular performance impact but the code is simpler this way.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 15 Oct 2012 17:43:05 +0200
parents ac5c9c8046f7
children 21503aa02d4f
files mercurial/revset.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Mon Oct 15 17:42:40 2012 +0200
+++ b/mercurial/revset.py	Mon Oct 15 17:43:05 2012 +0200
@@ -933,9 +933,7 @@
         for p in cl.parentrevs(r):
             if p >= baserev:
                 parentscount[p - baserev] += 1
-    branchpoints = set((baserev + i) for i in xrange(len(parentscount))
-                       if parentscount[i] > 1)
-    return [r for r in subset if r in branchpoints]
+    return [r for r in subset if (parentscount[r - baserev] > 1)]
 
 def minrev(repo, subset, x):
     """``min(set)``