Commit f83794f9 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use sort(key=) instead of sort(cmp=) for better performance.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23854 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6ddd1b19
......@@ -78,4 +78,4 @@ class MovementGroup(XMLObject):
# DO NOT OVERRIDE THIS METHOD. Override _separate() instead.
return sorted([[sorted(x[0], key=lambda x: x.getId()), x[1]] \
for x in self._separate(movement_list)],
lambda a,b: cmp(a[0][0].getId(), b[0][0].getId()))
key=lambda x: x[0][0].getId())
......@@ -290,7 +290,7 @@ def getSearchDialog(self, REQUEST=None):
field_id='your_category_list'))
items = [('', '')] + sorted([(translateString(x.title), x.id) for x
in workflow.states.objectValues()],
lambda a, b: cmp(a[0], b[0]))
key=lambda x: x[0])
field._surcharged_edit(
dict(title=translateString(workflow.title),
items=items,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment