From bcbd5801c2be23b2ee1a22e7b088fc2fb654f1c9 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Fri, 27 Jun 2008 14:43:24 +0000 Subject: some cleanups, add missing destroy calls, fix incomplete destroy calls, small speedup --- lib/python/Components/Element.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/python/Components/Element.py') diff --git a/lib/python/Components/Element.py b/lib/python/Components/Element.py index 437d934b..2af57793 100644 --- a/lib/python/Components/Element.py +++ b/lib/python/Components/Element.py @@ -8,11 +8,12 @@ from Tools.CList import CList def cached(f): name = f.__name__ def wrapper(self): - if self.cache is None: + cache = self.cache + if cache is None: return f(self) - if name not in self.cache: - self.cache[name] = (True, f(self)) - return self.cache[name][1] + if name not in cache: + cache[name] = (True, f(self)) + return cache[name][1] return wrapper class Element(object): -- cgit v1.2.3