refactor: use list comprehension (#3308)

This commit is contained in:
David Culley 2024-07-21 10:21:41 +02:00 committed by GitHub
parent fef30b48d3
commit b01f89e7eb

View file

@ -172,10 +172,7 @@ class Note(DeprecatedNamesMixin):
return self.col.tags.in_list(tag, self.tags)
def remove_tag(self, tag: str) -> None:
rem = []
for tag_ in self.tags:
if tag_.lower() == tag.lower():
rem.append(tag_)
rem = [tag_ for tag_ in self.tags if tag_.lower() == tag.lower()]
for tag_ in rem:
self.tags.remove(tag_)