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
d9b19a5f
Commit
d9b19a5f
authored
Mar 17, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed to take account of the posibility of some new data structures
mixed with old. Need to copy length value to __len__.
parent
1223f49f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
lib/python/SearchIndex/UnIndex.py
lib/python/SearchIndex/UnIndex.py
+10
-3
No files found.
lib/python/SearchIndex/UnIndex.py
View file @
d9b19a5f
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
"""Simple column indices"""
"""Simple column indices"""
__version__
=
'$Revision: 1.2
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
8
$'
[
11
:
-
2
]
from
Globals
import
Persistent
from
Globals
import
Persistent
from
Acquisition
import
Implicit
from
Acquisition
import
Implicit
...
@@ -169,10 +169,17 @@ class UnIndex(Persistent, Implicit):
...
@@ -169,10 +169,17 @@ class UnIndex(Persistent, Implicit):
_index
=
self
.
_index
_index
=
self
.
_index
self
.
_index
=
OOBTree
()
self
.
_index
=
OOBTree
()
def
convertSet
(
s
,
IITreeSet
=
IITreeSet
):
def
convertSet
(
s
,
IITreeSet
=
IITreeSet
,
IntType
=
type
(
0
),
type
=
type
,
len
=
len
,
doneTypes
=
(
IntType
,
IITreeSet
)):
if
type
(
s
)
in
doneTypes
:
return
s
if
len
(
s
)
==
1
:
if
len
(
s
)
==
1
:
try
:
return
s
[
0
]
# convert to int
try
:
return
s
[
0
]
# convert to int
except
:
pass
# This is just an optimization.
except
:
pass
# This is just an optimization.
return
IITreeSet
(
s
)
return
IITreeSet
(
s
)
convert
(
_index
,
self
.
_index
,
threshold
,
convertSet
)
convert
(
_index
,
self
.
_index
,
threshold
,
convertSet
)
...
@@ -181,7 +188,7 @@ class UnIndex(Persistent, Implicit):
...
@@ -181,7 +188,7 @@ class UnIndex(Persistent, Implicit):
self
.
_unindex
=
IOBTree
()
self
.
_unindex
=
IOBTree
()
convert
(
_unindex
,
self
.
_unindex
,
threshold
)
convert
(
_unindex
,
self
.
_unindex
,
threshold
)
self
.
__len__
=
BTrees
.
Length
.
Length
()
self
.
__len__
=
BTrees
.
Length
.
Length
(
len
(
_index
)
)
def
__nonzero__
(
self
):
def
__nonzero__
(
self
):
return
not
not
self
.
_unindex
return
not
not
self
.
_unindex
...
...
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