D7427: branchmap: make "closed" a set from beginning instead of converting from list

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Nov 15 06:04:52 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7427

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -107,14 +107,14 @@
         clrev = cl.rev
         clbranchinfo = cl.branchinfo
         rbheads = []
-        closed = []
+        closed = set()
         for bheads in pycompat.itervalues(remotebranchmap):
             rbheads += bheads
             for h in bheads:
                 r = clrev(h)
                 b, c = clbranchinfo(r)
                 if c:
-                    closed.append(h)
+                    closed.add(h)
 
         if rbheads:
             rtiprev = max((int(clrev(node)) for node in rbheads))
@@ -122,7 +122,7 @@
                 remotebranchmap,
                 repo[rtiprev].node(),
                 rtiprev,
-                closednodes=set(closed),
+                closednodes=closed,
             )
 
             # Try to stick it as low as possible



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list