Commit d4c2dcb5 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Work around performance decrease introduced in Zope 2.12.23.

Otherwise, we use superclass' __contains__ implementation, which uses
objectIds, which is inefficient in HBTreeFolder2 to lookup a single key.

This commit reverts fdf4fa44 that does not work in reality.
parent b3738568
...@@ -1061,6 +1061,8 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn): ...@@ -1061,6 +1061,8 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn):
return False return False
return CMFBTreeFolder.hasObject(self, id) return CMFBTreeFolder.hasObject(self, id)
__contains__ = hasObject
# Override Zope default by folder id generation # Override Zope default by folder id generation
def _get_id(self, id): def _get_id(self, id):
if self._getOb(id, None) is None : if self._getOb(id, None) is None :
......
...@@ -628,10 +628,6 @@ class HBTreeFolder2Base (Persistent): ...@@ -628,10 +628,6 @@ class HBTreeFolder2Base (Persistent):
raise AttributeError, name raise AttributeError, name
return res return res
def __contains__(self, key):
marker = []
return self._getOb(key, marker) is not marker
InitializeClass(HBTreeFolder2Base) InitializeClass(HBTreeFolder2Base)
......
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