# HG changeset patch # User Joerg Sonnenberger # Date 2024-06-24 01:16:52 # Node ID ff523675cd69fff74d7a5997464c8f82f7e222a1 # Parent f28c52a9f7b4187b085371792a8b341bc8d327cc obsolete: simplify relevantmarker Drop duplicate assignment from a merge failure. Save one loop iteration by exploiting that pendingnodes will be seennodes after the first round anyway, so just pre-initialize the set accordingly. From Anton Shestakov's review on !867. Performance difference for my test case is in the noise. diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -799,8 +799,7 @@ class obsstore: if rev is not None and rev in revs: pendingnodes.add(node) seenmarkers = set() - seenmarkers = set() - seennodes = set() + seennodes = set(pendingnodes) precursorsmarkers = self.predecessors succsmarkers = self.successors children = self.children