changeset 10849:12ffc5ce1291

templater: cache self.defaults.get
author Matt Mackall <mpm@selenic.com>
date Mon, 05 Apr 2010 15:25:08 -0500
parents 01346cea5485
children a63391e26284
files mercurial/templater.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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