Skip to content

Commit

Permalink
used del instead of deleting a slice
Browse files Browse the repository at this point in the history
  • Loading branch information
tfallon0 committed Nov 18, 2023
1 parent 1350b54 commit fb0dd4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ def components(edges: list[tuple[str,str]]) -> set[frozenset[str]]:
found = n
else:
comp_list[found] |= component
comp_list[n:n+1] = []
del comp_list[n]
break
elif a not in component and b in component:
component.add(a)
if found is None:
found = n
else:
comp_list[found] |= component
comp_list[n:n+1] = []
del comp_list[n]
break
elif a in component and b in component:
found = n
Expand Down

0 comments on commit fb0dd4c

Please sign in to comment.