aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cogs
diff options
context:
space:
mode:
authorGravatar Shirayuki Nekomata <[email protected]>2020-02-04 12:26:27 +0700
committerGravatar Shirayuki Nekomata <[email protected]>2020-02-04 12:26:27 +0700
commit868de4716c5b6a3120f665d460a8987bd6f16302 (patch)
treec373c577bc88abc6afb64e186e58560f8585337a /tests/cogs
parentFixed _last_fetch not being updated after each api call. (diff)
Refactored _get_suggestions following Mark's suggestions about inefficiency.
- Matching scores will be calculated once now and stored in the dict `scores`. - Allow `_get_suggestions()` to go through a list of score threshold and return the first list of matching tags that's not empty and above the threshold. This avoid calling the function multiple time like before ( `self._get_suggestions(tag_name, 100) or self._get_suggestions(tag_name, 80)` for example, is calling this function twice, and is inefficient ) - Deleted commented line. - Added `typing` module for more typehints.
Diffstat (limited to 'tests/cogs')
0 files changed, 0 insertions, 0 deletions