copies: simplify chain loop
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 17 Oct 2019 16:06:06 +0200
changeset 43302 f0a2c1972e81
parent 43301 90213d027154
child 43303 26caf96a5fa9
copies: simplify chain loop This is a mostly gratuitous change to make the code more direct. Differential Revision: https://phab.mercurial-scm.org/D7131
mercurial/copies.py
--- a/mercurial/copies.py	Thu Oct 17 02:17:24 2019 +0200
+++ b/mercurial/copies.py	Thu Oct 17 16:06:06 2019 +0200
@@ -67,10 +67,7 @@
     """chain two sets of copies 'a' and 'b'"""
     t = a.copy()
     for k, v in pycompat.iteritems(b):
-        if v in t:
-            t[k] = t[v]
-        else:
-            t[k] = v
+        t[k] = t.get(v, v)
     return t