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

login
register
mail settings
Submitter phabricator
Date Nov. 18, 2019, 4:49 p.m.
Message ID <3adfacc830f8c3f1161f7a0a6b28fe4b@localhost.localdomain>
Download mbox | patch
Permalink /patch/43331/
State Not Applicable
Headers show

Comments

phabricator - Nov. 18, 2019, 4:49 p.m.
Closed by commit rHG5cdc3c1292f6: branchmap: make &quot;closed&quot; a set from beginning instead of converting from list (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7427?vs=18153&id=18211

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7427/new/

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS




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

Patch

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