[Erp5-report] r29696 - /erp5/trunk/products/ERP5Type/CachePlugins/RamCache.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 16 00:51:27 CEST 2009


Author: yo
Date: Fri Oct 16 00:51:26 2009
New Revision: 29696

URL: http://svn.erp5.org?rev=29696&view=rev
Log:
Speed optimization ("is" is much faster than "isinstance").

Modified:
    erp5/trunk/products/ERP5Type/CachePlugins/RamCache.py

Modified: erp5/trunk/products/ERP5Type/CachePlugins/RamCache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/CachePlugins/RamCache.py?rev=29696&r1=29695&r2=29696&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/CachePlugins/RamCache.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/CachePlugins/RamCache.py [utf8] Fri Oct 16 00:51:26 2009
@@ -73,8 +73,8 @@
 
   def get(self, cache_id, scope, default=_MARKER):
     cache = self.getCacheStorage()
-    cache_entry = cache.get((scope, cache_id), default)
-    if isinstance(cache_entry, CacheEntry):
+    cache_entry = cache.get((scope, cache_id), _MARKER)
+    if cache_entry is not _MARKER:
       if not cache_entry.isExpired():
         #The value is well retrieved from cache storage
         cache_entry.markCacheHit()




More information about the Erp5-report mailing list