Commit 89a6082b 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@23767 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 88aba261
......@@ -2252,7 +2252,7 @@ class Base( CopyContainer,
value = self._getCategoryTool().resolveCategory(path)
if value is not None:
result += [value]
result.sort(lambda x, y: cmp(getattr(x,sort_id)(),getattr(y,sort_id)()))
result.sort(key=lambda x: getattr(x,sort_id)())
if method_id is None:
return [(x, x) for x in membership_list]
return [(x,getattr(x, method_id)()) for x in membership_list]
......
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