changeset 51643:ff523675cd69

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.
author Joerg Sonnenberger <joerg@bec.de>
date Mon, 24 Jun 2024 03:16:52 +0200
parents f28c52a9f7b4
children f02ec1ecb3bf
files mercurial/obsolete.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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