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
ee427cb5
Commit
ee427cb5
authored
Nov 16, 2005
by
Martijn Pieters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor PathIndex search, reducing it's memory use somewhat.
parent
76a2f191
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
+10
-19
No files found.
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
View file @
ee427cb5
...
@@ -177,32 +177,23 @@ class PathIndex(Persistent, SimpleItem):
...
@@ -177,32 +177,23 @@ class PathIndex(Persistent, SimpleItem):
if
len
(
comps
)
==
0
:
if
len
(
comps
)
==
0
:
return
IISet
(
self
.
_unindex
.
keys
())
return
IISet
(
self
.
_unindex
.
keys
())
results
=
None
if
level
>=
0
:
if
level
>=
0
:
results
=
[]
for
i
,
comp
in
enumerate
(
comps
):
for
i
in
range
(
len
(
comps
)):
comp
=
comps
[
i
]
if
not
self
.
_index
.
has_key
(
comp
):
return
IISet
()
if
not
self
.
_index
.
has_key
(
comp
):
return
IISet
()
if
not
self
.
_index
[
comp
].
has_key
(
level
+
i
):
return
IISet
()
if
not
self
.
_index
[
comp
].
has_key
(
level
+
i
):
return
IISet
()
results
.
append
(
self
.
_index
[
comp
][
level
+
i
]
)
results
=
intersection
(
results
,
self
.
_index
[
comp
][
level
+
i
])
res
=
results
[
0
]
for
i
in
range
(
1
,
len
(
results
)):
res
=
intersection
(
res
,
results
[
i
])
return
res
else
:
else
:
results
=
IISet
()
for
level
in
range
(
self
.
_depth
+
1
):
for
level
in
range
(
0
,
self
.
_depth
+
1
):
ids
=
None
ids
=
None
error
=
0
for
i
,
comp
in
enumerate
(
comps
):
for
cn
in
range
(
0
,
len
(
comps
)):
comp
=
comps
[
cn
]
try
:
try
:
ids
=
intersection
(
ids
,
self
.
_index
[
comp
][
level
+
cn
])
ids
=
intersection
(
ids
,
self
.
_index
[
comp
][
level
+
i
])
except
KeyError
:
except
KeyError
:
error
=
1
break
if
error
==
0
:
else
:
results
=
union
(
results
,
ids
)
results
=
union
(
results
,
ids
)
return
results
return
results
def
numObjects
(
self
):
def
numObjects
(
self
):
...
...
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