plugin/display_corrections: prefer generator to list when looping

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2020-04-04 00:20:57 +02:00
parent ea53698fd7
commit 01a1d4441e
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -43,7 +43,7 @@ class Plugin(BasePlugin):
messages = self.api.get_conversation_messages() messages = self.api.get_conversation_messages()
if not messages: if not messages:
return None return None
for message in messages[::-1]: for message in reversed(messages):
if message.old_message: if message.old_message:
if nb == 1: if nb == 1:
return message return message