changeset 5365:6af94b3be29e stable

obsdiscovery: assign successors and predecessors to variables Since we're optimizing this loop by removing dots, why not remove all dots.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 06 Jun 2020 20:32:38 +0800
parents 54bf9ec2f81d
children 3334f6752bdc
files hgext3rd/evolve/obsdiscovery.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obsdiscovery.py	Sat Jun 06 19:43:58 2020 +0800
+++ b/hgext3rd/evolve/obsdiscovery.py	Sat Jun 06 20:32:38 2020 +0800
@@ -296,7 +296,8 @@
     node_to_proceed = set()
     marker_to_proceed = set(known_markers)
 
-    obsstore = repo.obsstore
+    successors = repo.obsstore.successors
+    predecessors = repo.obsstore.predecessors
 
     while node_to_proceed or marker_to_proceed:
         while marker_to_proceed:
@@ -317,8 +318,8 @@
         if node_to_proceed:
             node = node_to_proceed.pop()
             markers = set()
-            markers.update(obsstore.successors.get(node, ()))
-            markers.update(obsstore.predecessors.get(node, ()))
+            markers.update(successors.get(node, ()))
+            markers.update(predecessors.get(node, ()))
             markers -= known_markers
             marker_to_proceed.update(markers)
             known_markers.update(markers)