Commit 30d06843 authored by Julien Muchembled's avatar Julien Muchembled

Remove 2 useless caches because _getTypeBasedMethod already caches results

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33697 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 445d13f0
...@@ -220,27 +220,12 @@ class PermanentURLMixIn(ExtensibleTraversableMixIn): ...@@ -220,27 +220,12 @@ class PermanentURLMixIn(ExtensibleTraversableMixIn):
if name is None: if name is None:
return self.getDefaultDocumentValue() return self.getDefaultDocumentValue()
cache = getReadOnlyTransactionCache(self) method = self._getTypeBasedMethod('getDocumentValue',
method = None
if cache is not None:
key = ('getDocumentValue', self)
try:
method = cache[key]
except KeyError:
pass
if method is None:
method = self._getTypeBasedMethod('getDocumentValue',
fallback_script_id='WebSection_getDocumentValue') fallback_script_id='WebSection_getDocumentValue')
if cache is not None:
if cache.get(key, _MARKER) is _MARKER:
cache[key] = method
document = method(name, portal=portal, **kw) document = method(name, portal=portal, **kw)
if document is not None: if document is not None:
document = document.__of__(self) return document.__of__(self)
return document
class DocumentProxyMixin: class DocumentProxyMixin:
""" """
...@@ -695,18 +680,7 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, S ...@@ -695,18 +680,7 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, S
NOTE: passing a group_by parameter may be useful at a NOTE: passing a group_by parameter may be useful at a
later stage of the implementation. later stage of the implementation.
""" """
tv = getTransactionalVariable(self) # XXX Performance improvement required return self._getTypeBasedMethod('getImplicitPredecessorValueList')()
cache_key = ('getImplicitPredecessorValueList', self.getPhysicalPath())
try:
return tv[cache_key]
except KeyError:
pass
method = self._getTypeBasedMethod('getImplicitPredecessorValueList',
fallback_script_id = 'Base_getImplicitPredecessorValueList')
result = method()
tv[cache_key] = result
return result
security.declareProtected(Permissions.AccessContentsInformation, 'getImplicitSimilarValueList') security.declareProtected(Permissions.AccessContentsInformation, 'getImplicitSimilarValueList')
def getImplicitSimilarValueList(self): def getImplicitSimilarValueList(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment