From e213c0a6d196cbe19bc291141af97c4d6057141d Mon Sep 17 00:00:00 2001 From: David Culley <6276049+davidculley@users.noreply.github.com> Date: Sun, 21 Jul 2024 10:21:41 +0200 Subject: [PATCH] refactor: use list comprehension (#3308) --- pylib/anki/notes.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pylib/anki/notes.py b/pylib/anki/notes.py index aab8a1b63..f3a51db19 100644 --- a/pylib/anki/notes.py +++ b/pylib/anki/notes.py @@ -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_)