templater: deduplicate iterator of overlay mappings
authorYuya Nishihara <yuya@tcha.org>
Mon, 02 Apr 2018 21:54:12 +0900
changeset 37405 da8e9ecac4a4
parent 37404 7c902a8345ef
child 37406 8c37c3220ebc
templater: deduplicate iterator of overlay mappings
mercurial/templateutil.py
--- a/mercurial/templateutil.py	Sun Mar 18 21:01:23 2018 +0900
+++ b/mercurial/templateutil.py	Mon Apr 02 21:54:12 2018 +0900
@@ -599,9 +599,7 @@
         diter = d.itermaps(context)
     else:
         diter = _checkeditermaps(darg, d)
-    for i, v in enumerate(diter):
-        lm = context.overlaymap(mapping, v)
-        lm['index'] = i
+    for lm in _iteroverlaymaps(context, mapping, diter):
         yield evalrawexp(context, lm, targ)
 
 def runmember(context, mapping, data):