refactor: use list comprehension (#3308)

This commit is contained in:
David Culley 2024-07-21 10:21:41 +02:00 committed by GitHub
parent bb5ed4da9c
commit e213c0a6d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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_)