From 67365a72c71787cc3c0bd544b268c1e666965cf4 Mon Sep 17 00:00:00 2001 From: Marcus Burghardt Date: Thu, 23 May 2024 16:11:14 +0200 Subject: [PATCH] Convert list to dict It will improve the performance when interacting with profile variables. --- utils/profile_tool/profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/profile_tool/profile.py b/utils/profile_tool/profile.py index 69f0fb2611c..8154948b253 100644 --- a/utils/profile_tool/profile.py +++ b/utils/profile_tool/profile.py @@ -44,7 +44,7 @@ def __init__(self, path, title): self.path = path self.title = title self.rules = [] - self.variables = [] + self.variables = {} self.unselected_rules = [] profile_file = os.path.basename(path) self.id = profile_file.split('.profile')[0] @@ -57,7 +57,7 @@ def add_rule(self, rule_id): self.rules.append(rule_id) else: variable_name, variable_value = rule_id.split('=', 1) - self.variables.append({variable_name: variable_value}) + self.variables[variable_name] = variable_value def add_rules(self, rules): for rule in rules: