copies: inline a variable that's used only once
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 21 Jun 2018 22:07:34 -0700
changeset 39945 85c8ff26d698
parent 39944 75b53b809e87
child 39946 2b4c8fa08504
copies: inline a variable that's used only once By inlining it, we also avoid calculating the value when "if of in seen" is false (probably not significant). Differential Revision: https://phab.mercurial-scm.org/D4831
mercurial/copies.py
--- a/mercurial/copies.py	Sat Sep 15 22:56:57 2018 -0700
+++ b/mercurial/copies.py	Thu Jun 21 22:07:34 2018 -0700
@@ -816,11 +816,10 @@
     of = None
     seen = {f}
     for oc in getsrcfctx(f, msrc[f]).ancestors():
-        ocr = oc.linkrev()
         of = oc.path()
         if of in seen:
             # check limit late - grab last rename before
-            if ocr < limit:
+            if oc.linkrev() < limit:
                 break
             continue
         seen.add(of)