# HG changeset patch # User Martin von Zweigbergk # Date 2019-11-15 05:13:46 # Node ID 5cdc3c1292f68e29b1c02a58de696ef7d0a8c482 # Parent f1dabf99db171732000d2a66ad1f25e26c6afb21 branchmap: make "closed" a set from beginning instead of converting from list Differential Revision: https://phab.mercurial-scm.org/D7427 diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -107,14 +107,14 @@ class BranchMapCache(object): 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 @@ class BranchMapCache(object): remotebranchmap, repo[rtiprev].node(), rtiprev, - closednodes=set(closed), + closednodes=closed, ) # Try to stick it as low as possible