ancestor: remove alias of initrevs from _lazyancestorsiter()
authorYuya Nishihara <yuya@tcha.org>
Tue, 11 Sep 2018 22:38:32 +0900
changeset 39550 f6bcb4f9cd3c
parent 39549 55eea29833d2
child 39551 fd9029d36c41
ancestor: remove alias of initrevs from _lazyancestorsiter() It's just redundant and less comprehensible.
mercurial/ancestor.py
--- a/mercurial/ancestor.py	Tue Sep 11 10:36:07 2018 -0700
+++ b/mercurial/ancestor.py	Tue Sep 11 22:38:32 2018 +0900
@@ -262,20 +262,18 @@
 # Extracted from lazyancestors.__iter__ to avoid a reference cycle
 def _lazyancestorsiter(parentrevs, initrevs, stoprev, inclusive):
     seen = {nullrev}
-    revs = initrevs
-
     schedule = heapq.heappush
     nextitem = heapq.heappop
     see = seen.add
 
     if inclusive:
-        visit = [-r for r in revs]
-        seen.update(revs)
+        visit = [-r for r in initrevs]
+        seen.update(initrevs)
         heapq.heapify(visit)
     else:
         visit = []
         heapq.heapify(visit)
-        for r in revs:
+        for r in initrevs:
             for parent in parentrevs(r):
                 if parent not in seen:
                     schedule(visit, -parent)