obsolete: simplify relevantmarker
authorJoerg Sonnenberger <joerg@bec.de>
Mon, 24 Jun 2024 03:16:52 +0200
changeset 51643 ff523675cd69
parent 51642 f28c52a9f7b4
child 51644 f02ec1ecb3bf
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.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Tue Jun 11 18:47:50 2024 +0200
+++ b/mercurial/obsolete.py	Mon Jun 24 03:16:52 2024 +0200
@@ -799,8 +799,7 @@
                     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