Use a reversed range instead of while

This commit is contained in:
Dan Elkouby 2018-05-05 16:03:49 +03:00
parent 5b80fb7c5b
commit 5310c55a93
1 changed files with 1 additions and 3 deletions

View File

@ -79,9 +79,7 @@ class Uniborg(TelegramClient):
def remove_plugin(self, shortname): def remove_plugin(self, shortname):
name = self._plugins[shortname].__name__ name = self._plugins[shortname].__name__
i = len(self._event_builders) for i in reversed(range(len(self._event_builders))):
while i:
i -= 1
ev, cb = self._event_builders[i] ev, cb = self._event_builders[i]
if cb.__module__ == name: if cb.__module__ == name:
del self._event_builders[i] del self._event_builders[i]