Replace len by sum for generator

This commit is contained in:
Mikhail f. Shiryaev 2023-12-07 00:57:01 +01:00
parent b44dadc5c6
commit cfe6bc2cc5
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -160,9 +160,7 @@ def handler(event: dict, context: Any) -> dict:
steps = 0
else:
# We record only finished steps
steps = len(
[step for step in wf_job["steps"] if step["conclusion"] is not None]
)
steps = sum(1 for st in wf_job["steps"] if st["conclusion"] is not None)
workflow_job = WorkflowJob(
wf_job["id"],