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
9b736188
Commit
9b736188
authored
May 17, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement unique using an IITreeSet as suggested by Tim.
parent
0d93f320
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
lib/python/Products/ZCTextIndex/BaseIndex.py
lib/python/Products/ZCTextIndex/BaseIndex.py
+4
-7
No files found.
lib/python/Products/ZCTextIndex/BaseIndex.py
View file @
9b736188
...
...
@@ -18,7 +18,7 @@
import
math
from
BTrees.IOBTree
import
IOBTree
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IITreeSet
from
Products.ZCTextIndex.IIndex
import
IIndex
from
Products.ZCTextIndex
import
WidCode
...
...
@@ -44,12 +44,9 @@ def scaled_int(f, scale=SCALE_FACTOR):
# expensive.
return
int
(
f
*
scale
+
0.5
)
def
unique
(
l
):
"""Return a list of the unique elements in l."""
d
=
{}
for
elt
in
l
:
d
[
elt
]
=
1
return
d
.
keys
()
def
unique
(
L
):
"""Return a list of the unique elements in L."""
return
IITreeSet
(
L
).
keys
()
class
BaseIndex
(
Persistent
):
...
...
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