Commit 99a37fec authored by Hanno Schlichting's avatar Hanno Schlichting Committed by GitHub

Merge pull request #70 from zopefoundation/revert-contains-optimization-on-213

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