Author: justi9
Date: 2008-12-16 15:33:42 -0500 (Tue, 16 Dec 2008)
New Revision: 3012
Modified:
mgmt/trunk/mint/python/mint/cache.py
Log:
A speedup; drop a capability we're not currently using, and don't look in the
hashtable twice on each get
Modified: mgmt/trunk/mint/python/mint/cache.py
===================================================================
--- mgmt/trunk/mint/python/mint/cache.py 2008-12-16 20:17:44 UTC (rev 3011)
+++ mgmt/trunk/mint/python/mint/cache.py 2008-12-16 20:33:42 UTC (rev 3012)
@@ -6,15 +6,9 @@
self.__pending = dict()
self.__dirty = False
- def get(self, key, usePending=True):
- result = None
+ def get(self, key):
+ return self.__cache.get(key)
- if key in self.__cache:
- result = self.__cache[key]
- elif usePending and key in self.__pending:
- result = self.__pending[key]
- return result
-
def set(self, key, value):
self.__pending[key] = value
self.__dirty = True
Show replies by date