Improve performance of value -> enum by about 5x.

This commit is contained in:
Rapptz
2019-04-15 21:30:47 -04:00
parent 2a301a4eb4
commit 6f26a4aad8
3 changed files with 57 additions and 4 deletions

View File

@ -216,7 +216,7 @@ class AuditLogEntry:
self._from_data(data)
def _from_data(self, data):
self.action = enums.AuditLogAction(data['action_type'])
self.action = enums.try_enum(enums.AuditLogAction, data['action_type'])
self.id = int(data['id'])
# this key is technically not usually present