aboutsummaryrefslogtreecommitdiff
path: root/discord/calls.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-10-09 05:37:37 -0400
committerRapptz <[email protected]>2017-01-03 09:51:47 -0500
commit31229a53e902e7cdc6f5f8d6e55e333cbc1fb0e6 (patch)
tree14612b14bfe19c436b13fee6077b91900b2d30c3 /discord/calls.py
parentBegin working on the rewrite. (diff)
downloaddiscord.py-31229a53e902e7cdc6f5f8d6e55e333cbc1fb0e6.tar.xz
discord.py-31229a53e902e7cdc6f5f8d6e55e333cbc1fb0e6.zip
Optimise VoiceState for memory.
Instead of storing one VoiceState per Member, only store them if necessary. This should bring down the number of instances significantly.
Diffstat (limited to 'discord/calls.py')
-rw-r--r--discord/calls.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/discord/calls.py b/discord/calls.py
index 40df55ac..6a221e50 100644
--- a/discord/calls.py
+++ b/discord/calls.py
@@ -117,8 +117,7 @@ class GroupCall:
if data['channel_id'] is None:
self._voice_states.pop(user_id, None)
else:
- data['voice_channel'] = self.channel
- self._voice_states[user_id] = VoiceState(**data)
+ self._voice_states[user_id] = VoiceState(data=data, channel=self.channel)
@property
def connected(self):