mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Optimise tight loops in DiscordGateway.received_message
* type(x) is y is faster than isinstance(x, y) * Re-arrange if-statements for common statements * Drop handler getattr for most events that don't use it
This commit is contained in:
1 parent
095f0ec2fc
commit
2721689254
4 files changed
+55
-46
No files matched your search
+2
-1
@@ -124,7 +124,8 @@ class AutoShardedClient(Client):
|
||||
raise ClientException('shard_ids parameter must be a list or a tuple.')
|
||||
|
||||
self._connection = AutoShardedConnectionState(dispatch=self.dispatch, chunker=self._chunker,
|
||||
syncer=self._syncer, http=self.http, loop=self.loop, **kwargs)
|
||||
handlers=self._handlers, syncer=self._syncer,
|
||||
http=self.http, loop=self.loop, **kwargs)
|
||||
|
||||
# instead of a single websocket, we have multiple
|
||||
# the key is the shard_id
|
||||
|
||||
Reference in new issue
Block a user