mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Improve performance of value -> enum by about 5x.
This commit is contained in:
1 parent
2a301a4eb4
commit
6f26a4aad8
3 files changed
+57
-4
No files matched your search
+1
-1
@@ -164,7 +164,7 @@ class BaseUser(_BaseUser):
|
||||
@property
|
||||
def default_avatar(self):
|
||||
"""Returns the default avatar for a given user. This is calculated by the user's discriminator"""
|
||||
return DefaultAvatar(int(self.discriminator) % len(DefaultAvatar))
|
||||
return try_enum(DefaultAvatar, int(self.discriminator) % len(DefaultAvatar))
|
||||
|
||||
@property
|
||||
def default_avatar_url(self):
|
||||
|
||||
Reference in new issue
Block a user