Skip to content

Commit

Permalink
Filter out None results in selector more efficiently (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
werux authored Feb 19, 2024
1 parent 8aca284 commit 0d317f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/canmatrix/formats/arxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ def selector(self, start_element, selector):
filtered_results.append(tag)
result_list = filtered_results

result_list = [result for result in set(result_list) if result is not None]
result_list = list(set(result_list))
if None in result_list:
result_list.remove(None)

last_found_token = found_token[1] + start_pos
token = selector[start_pos + found_token[0]:start_pos + found_token[1]]
Expand Down

0 comments on commit 0d317f8

Please sign in to comment.