Commit 9187326b authored by iv's avatar iv

ERP5Workflow: PERF: improve folder's objectValues

by using list comprehension instead of filter
parent d844e9af
......@@ -1537,8 +1537,7 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn):
if portal_type is not None:
if isinstance(portal_type, str):
portal_type = (portal_type,)
object_list = filter(lambda x: x.getPortalType() in portal_type,
object_list)
object_list = [o for o in object_list if o.getPortalType() in portal_type]
if checked_permission is not None:
checkPermission = getSecurityManager().checkPermission
object_list = [o for o in object_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