Skip to content

Commit

Permalink
Convert list to dict
Browse files Browse the repository at this point in the history
It will improve the performance when interacting with profile variables.
  • Loading branch information
marcusburghardt committed May 23, 2024
1 parent 7b05f60 commit 67365a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/profile_tool/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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:
Expand Down

0 comments on commit 67365a7

Please sign in to comment.