Commit 700675ee authored by iv's avatar iv

ERP5Workflow: PERF: list comprehension instead of appending objects

parent 9187326b
......@@ -210,11 +210,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
security.declarePrivate('getTransitionIdList')
def getTransitionIdList(self):
id_list = []
append = id_list.append
for ob in self.objectValues(portal_type="Interaction"):
append(ob.getReference())
return id_list
return [ob.getReference() for ob in self.objectValues(portal_type="Interaction")]
security.declarePrivate('notifyWorkflowMethod')
def notifyWorkflowMethod(self, ob, transition_list, args=None, kw=None):
......
......@@ -142,9 +142,10 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject,
key_list.append('validation_state')
if self.getMatchedCausalityState():
key_list.append('causality_state')
for dynamic_variable in self.objectValues():
if dynamic_variable.getVariableValue() or dynamic_variable.getVariableExpression():
key_list.append(dynamic_variable.getReference())
key_list += [dynamic_variable.getReference() for dynamic_variable in self.objectValues()
if dynamic_variable.getVariableValue() or dynamic_variable.getVariableExpression()]
return key_list
security.declareProtected(Permissions.AccessContentsInformation,
......
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