From 2b8a5b6f5b275c40af1139fab07461e6e96bdeb4 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Sun, 15 Aug 2021 22:09:32 +0200 Subject: Move definition of loop vars next to loop --- bot/exts/info/tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/info/tags.py b/bot/exts/info/tags.py index d659be8c4..8bb682366 100644 --- a/bot/exts/info/tags.py +++ b/bot/exts/info/tags.py @@ -114,10 +114,10 @@ class Tag: def _fuzzy_search(search: str, target: str) -> float: """A simple scoring algorithm based on how many letters are found / total, with order in mind.""" - current, index = 0, 0 _search = REGEX_NON_ALPHABET.sub("", search.lower()) _targets = iter(REGEX_NON_ALPHABET.split(target.lower())) + current, index = 0, 0 for _target in _targets: while index < len(_target) and _search[current] == _target[index]: current += 1 -- cgit v1.2.3