templater: do not destructure operands in buildmap()
authorYuya Nishihara <yuya@tcha.org>
Sat, 02 Sep 2017 23:09:34 +0900
changeset 34325 86d050abd5c1
parent 34324 e473f482b9b3
child 34326 e60c601953d7
templater: do not destructure operands in buildmap() This makes the next patch slightly simpler.
mercurial/templater.py
--- a/mercurial/templater.py	Sat Sep 09 19:01:18 2017 +0900
+++ b/mercurial/templater.py	Sat Sep 02 23:09:34 2017 +0900
@@ -410,12 +410,12 @@
         raise error.Abort(msg)
 
 def buildmap(exp, context):
-    func, data = compileexp(exp[1], context, methods)
-    tfunc, tdata = gettemplate(exp[2], context)
-    return (runmap, (func, data, tfunc, tdata))
+    darg = compileexp(exp[1], context, methods)
+    targ = gettemplate(exp[2], context)
+    return (runmap, (darg, targ))
 
 def runmap(context, mapping, data):
-    func, data, tfunc, tdata = data
+    (func, data), (tfunc, tdata) = data
     d = func(context, mapping, data)
     if util.safehasattr(d, 'itermaps'):
         diter = d.itermaps()