# HG changeset patch # User Pierre-Yves David # Date 1350315785 -7200 # Node ID 72c234081ae1350220132c69750f5a093902a1e7 # Parent ac5c9c8046f72883b7532ed06571b85624b284be 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. diff -r ac5c9c8046f7 -r 72c234081ae1 mercurial/revset.py --- 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)``