From d3068af2a8b6067e0c8a5574fa984eecd8027782 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Mon, 14 Nov 2022 16:15:19 +0100 Subject: [PATCH] Optimize code (tasks list initialization, task verification) Signed-off-by: Przemek Stekiel --- tests/scripts/analyze_outcomes.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/scripts/analyze_outcomes.py b/tests/scripts/analyze_outcomes.py index 2cdad692b..ba38ec280 100755 --- a/tests/scripts/analyze_outcomes.py +++ b/tests/scripts/analyze_outcomes.py @@ -175,17 +175,15 @@ def main(): result = True - tasks = [] if options.task == 'all': - for task in TASKS: - tasks.append(task) + tasks = TASKS.keys() else: tasks = options.task.split(',') - for task in tasks: - if task not in TASKS: - print('Error: invalid task: {}'.format(task)) - sys.exit(1) + for task in tasks: + if task not in TASKS: + print('Error: invalid task: {}'.format(task)) + sys.exit(1) for task in TASKS: if task in tasks: