Skip to content

Commit e5512cb

Browse files
Apply suggested fix to tna_utilities/url.py from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 8aeb3fb commit e5512cb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tna_utilities/url.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,12 @@ def toggle_parameter_value(
126126

127127
for key, values in self.args:
128128
if key == parameter:
129-
if str(value) in values:
130-
self.remove_parameter_value(parameter, value)
129+
str_value = str(value)
130+
if str_value in values:
131+
values.remove(str_value)
131132
else:
132-
self.add_parameter_value(parameter, value)
133+
if str_value not in values:
134+
values.append(str_value)
133135
return self
134136
raise KeyError(f"Parameter '{parameter}' does not exist")
135137

0 commit comments

Comments
 (0)