From 41cfe3f805e53c43ec18585d203e0b80ed59afda Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Sat, 27 Feb 2021 02:52:05 +0100 Subject: Get the last index instead of using max The last index will always be the largest one so there's no need for max to search for it --- bot/exts/info/doc/_parsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/info/doc/_parsing.py b/bot/exts/info/doc/_parsing.py index 6b2d31cdd..b422b4f24 100644 --- a/bot/exts/info/doc/_parsing.py +++ b/bot/exts/info/doc/_parsing.py @@ -190,7 +190,7 @@ def _get_truncated_description( truncated_result = textwrap.shorten(result, truncate_index) else: # Truncate at the last Markdown element that comes before the truncation index. - markdown_truncate_index = max(possible_truncation_indices) + markdown_truncate_index = possible_truncation_indices[-1] truncated_result = result[:markdown_truncate_index] return truncated_result.strip(_TRUNCATE_STRIP_CHARACTERS) + "..." -- cgit v1.2.3