refactor: Replace for with dictionary comprehension

This commit is contained in:
PapaTutuWawa 2021-07-09 17:23:40 +02:00
parent d2032a5ccb
commit e1b14bcf5a

View File

@ -80,15 +80,11 @@ class SubscriptionManager:
if not module in self._subscriptions: if not module in self._subscriptions:
return {} return {}
tmp = {} return {
for jid in self._subscriptions[module]: jid: self._subscriptions[module][jid][keyword]["data"]
if not keyword in self._subscriptions[module][jid]: for jid in self._subscriptions[module]
continue if keyword in self._subscriptions[module][jid]
}
data = self._subscriptions[module][jid][keyword]["data"]
tmp[jid] = data
return tmp
def get_subscriptions_for_keywords(self, module, keywords): def get_subscriptions_for_keywords(self, module, keywords):
""" """