# HG changeset patch # User Pierre-Yves David # Date 1351094121 -7200 # Node ID 12178f07de97013dffa454765fdeef8947af0a7e # Parent ed225834b3720f249c74757963a96b1be98ccce0 bookmark: issue a single call to `allsuccessors` per loop Update to this code was minimalist when `allsuccessors` argument were changed from a list to a set. As this code is getting my attention again I realised we can drastically simplify this part of the code by issue a single call to `allsuccessors`. diff -r ed225834b372 -r 12178f07de97 mercurial/bookmarks.py --- a/mercurial/bookmarks.py Wed Oct 24 17:26:40 2012 +0200 +++ b/mercurial/bookmarks.py Wed Oct 24 17:55:21 2012 +0200 @@ -263,11 +263,8 @@ while len(validdests) != plen: plen = len(validdests) succs = set(c.node() for c in validdests) - for c in validdests: - if c.mutable(): - # obsolescence marker does not apply to public changeset - succs.update(obsolete.allsuccessors(repo.obsstore, - [c.node()])) + mutable = [c.node() for c in validdests if c.mutable()] + succs.update(obsolete.allsuccessors(repo.obsstore, mutable)) known = (n for n in succs if n in nm) validdests = set(repo.set('%ln::', known)) validdests.remove(old)