From 31229a53e902e7cdc6f5f8d6e55e333cbc1fb0e6 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 9 Oct 2016 05:37:37 -0400 Subject: 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. --- discord/calls.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'discord/calls.py') 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): -- cgit v1.2.3