Remove extend, fix index var

This commit is contained in:
Miroslav Kovar 2019-10-11 19:51:04 +02:00 committed by Lex Berezhny
parent 3c96fda59b
commit fbfe8f8d14
2 changed files with 2 additions and 6 deletions

View file

@ -544,7 +544,3 @@ class TagList(BaseMessageList[str]):
tag = normalize_tag(tag)
if tag and tag not in self.message:
self.message.append(tag)
def extend(self, tags: List[str]):
for tag in tags:
self.append(tag)

View file

@ -11,8 +11,8 @@ def normalize_tag(tag: str):
def clean_tags(tags: List[str]):
clean = []
for ind, tag in enumerate(tags):
for idx, tag in enumerate(tags):
norm_tag = normalize_tag(tag)
if norm_tag and norm_tag not in clean[:ind]:
if norm_tag and norm_tag not in clean[:idx]:
clean.append(norm_tag)
return clean