changeset 37405:da8e9ecac4a4

templater: deduplicate iterator of overlay mappings
author Yuya Nishihara <yuya@tcha.org>
date Mon, 02 Apr 2018 21:54:12 +0900
parents 7c902a8345ef
children 8c37c3220ebc
files mercurial/templateutil.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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):