Commit 0ab78eae authored by Maurits van Rees's avatar Maurits van Rees

Revert "Optimize 'OFS.ObjectManager.__contains__' method"

It causes problems with ZCatalog indexes.
See https://github.com/zopefoundation/Zope/issues/69

This reverts commit 753683e3.
parent a8139d86
...@@ -18,8 +18,6 @@ http://docs.zope.org/zope2/ ...@@ -18,8 +18,6 @@ http://docs.zope.org/zope2/
- Removed docstrings from some methods to avoid publishing them. From - Removed docstrings from some methods to avoid publishing them. From
Products.PloneHotfix20160419. [maurits] Products.PloneHotfix20160419. [maurits]
- Optimized the `OFS.ObjectManager.__contains__` method to do the
least amount of work necessary.
2.13.24 (2016-02-29) 2.13.24 (2016-02-29)
-------------------- --------------------
......
...@@ -786,11 +786,7 @@ class ObjectManager(CopyContainer, ...@@ -786,11 +786,7 @@ class ObjectManager(CopyContainer,
return self._setObject(key, value) return self._setObject(key, value)
def __contains__(self, name): def __contains__(self, name):
for ob in self._objects: return name in self.objectIds()
if name == ob['id']:
return True
return False
def __iter__(self): def __iter__(self):
return iter(self.objectIds()) return iter(self.objectIds())
......
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