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
610d49be
Commit
610d49be
authored
Jan 24, 2006
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sean Upton's optimization of BTreeFolder2.objectIds(). Should speed up
certain operations significantly.
parent
7470690c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
lib/python/Products/BTreeFolder2/BTreeFolder2.py
lib/python/Products/BTreeFolder2/BTreeFolder2.py
+15
-14
No files found.
lib/python/Products/BTreeFolder2/BTreeFolder2.py
View file @
610d49be
...
@@ -341,21 +341,22 @@ class BTreeFolder2Base (Persistent):
...
@@ -341,21 +341,22 @@ class BTreeFolder2Base (Persistent):
# Returns a list of subobject ids of the current object.
# Returns a list of subobject ids of the current object.
# If 'spec' is specified, returns objects whose meta_type
# If 'spec' is specified, returns objects whose meta_type
# matches 'spec'.
# matches 'spec'.
if
spec
is
not
None
:
if
isinstance
(
spec
,
StringType
):
mti
=
self
.
_mt_index
spec
=
[
spec
]
if
spec
is
None
:
mti
=
self
.
_mt_index
spec
=
mti
.
keys
()
#all meta types
set
=
None
for
meta_type
in
spec
:
if
isinstance
(
spec
,
StringType
):
ids
=
mti
.
get
(
meta_type
,
None
)
spec
=
[
spec
]
if
ids
is
not
None
:
set
=
None
set
=
union
(
set
,
ids
)
for
meta_type
in
spec
:
if
set
is
None
:
ids
=
mti
.
get
(
meta_type
,
None
)
return
()
if
ids
is
not
None
:
else
:
set
=
union
(
set
,
ids
)
return
set
.
keys
()
if
set
is
None
:
return
()
else
:
else
:
return
se
lf
.
_tree
.
keys
()
return
se
t
.
keys
()
security
.
declareProtected
(
access_contents_information
,
security
.
declareProtected
(
access_contents_information
,
...
...
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