Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
0b382a60
Commit
0b382a60
authored
8 years ago
by
Tres Seaver
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #62 from zopefoundation/patch2
Optimize "OFS.ObjectManager.__contains__" method (backport)
parents
561a1f4c
753683e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
doc/CHANGES.rst
doc/CHANGES.rst
+3
-1
src/OFS/ObjectManager.py
src/OFS/ObjectManager.py
+5
-1
No files found.
doc/CHANGES.rst
View file @
0b382a60
...
...
@@ -8,7 +8,9 @@ http://docs.zope.org/zope2/
2.13.25 (unreleased)
--------------------
- TBD
- Optimized the `OFS.ObjectManager.__contains__` method to do the
least amount of work necessary.
2.13.24 (2016-02-29)
--------------------
...
...
This diff is collapsed.
Click to expand it.
src/OFS/ObjectManager.py
View file @
0b382a60
...
...
@@ -787,7 +787,11 @@ class ObjectManager(CopyContainer,
return
self
.
_setObject
(
key
,
value
)
def
__contains__
(
self
,
name
):
return
name
in
self
.
objectIds
()
for
ob
in
self
.
_objects
:
if
name
==
ob
[
'id'
]:
return
True
return
False
def
__iter__
(
self
):
return
iter
(
self
.
objectIds
())
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment