From e1a946eb876fe011a8c1c0dfe5e844fd65481cbc Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Wed, 7 Nov 2018 19:10:27 -0300 Subject: [PATCH] pubsub.lazy_guild: use filter instead of genexpr --- litecord/pubsub/lazy_guild.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litecord/pubsub/lazy_guild.py b/litecord/pubsub/lazy_guild.py index 253115c..a7f3248 100644 --- a/litecord/pubsub/lazy_guild.py +++ b/litecord/pubsub/lazy_guild.py @@ -393,9 +393,11 @@ class GuildMemberList: } states = map(self.get_state, session_ids) + states = filter(lambda state: state is not None, states) + dispatched = [] - for state in (s for s in states if s is not None): + for state in states: await state.ws.dispatch( 'GUILD_MEMBER_LIST_UPDATE', payload)