templater: cache self.defaults.get
authorMatt Mackall <mpm@selenic.com>
Mon, 05 Apr 2010 15:25:08 -0500
changeset 10849 12ffc5ce1291
parent 10848 01346cea5485
child 10850 a63391e26284
templater: cache self.defaults.get
mercurial/templater.py
--- a/mercurial/templater.py	Mon Apr 05 15:25:08 2010 -0500
+++ b/mercurial/templater.py	Mon Apr 05 15:25:08 2010 -0500
@@ -73,10 +73,11 @@
     def _parse(self, tmpl):
         '''preparse a template'''
 
+        defget = self._defaults.get
         def getter(mapping, key):
             v = mapping.get(key)
             if v is None:
-                v = self.defaults.get(key, '')
+                v = defget(key, '')
             if hasattr(v, '__call__'):
                 v = v(**mapping)
             return v