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
d8557642
Commit
d8557642
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid overriding the all keyword and combine sort and reverse calls into one
parent
21c4e9e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/Products/ZCatalog/Catalog.py
src/Products/ZCatalog/Catalog.py
+7
-6
No files found.
src/Products/ZCatalog/Catalog.py
View file @
d8557642
...
...
@@ -869,15 +869,16 @@ def mergeResults(results, has_sort_keys, reverse):
# Concatenate the catalog results into one list and sort it
# Each result record consists of a list of tuples with three values:
# (sortkey, docid, catalog__getitem__)
combined
=
[]
if
len
(
results
)
>
1
:
all
=
[]
for
r
in
results
:
all
.
extend
(
r
)
combined
.
extend
(
r
)
elif
len
(
results
)
==
1
:
all
=
results
[
0
]
combined
=
results
[
0
]
else
:
return
[]
all
.
sort
()
if
reverse
:
all
.
reverse
()
return
LazyMap
(
lambda
rec
:
rec
[
2
](
rec
[
1
]),
all
,
len
(
all
))
combined
.
sort
(
reverse
=
True
)
else
:
combined
.
sort
()
return
LazyMap
(
lambda
rec
:
rec
[
2
](
rec
[
1
]),
combined
,
len
(
combined
))
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