refactor: Replace for with dictionary comprehension
This commit is contained in:
parent
d2032a5ccb
commit
e1b14bcf5a
@ -80,15 +80,11 @@ class SubscriptionManager:
|
||||
if not module in self._subscriptions:
|
||||
return {}
|
||||
|
||||
tmp = {}
|
||||
for jid in self._subscriptions[module]:
|
||||
if not keyword in self._subscriptions[module][jid]:
|
||||
continue
|
||||
|
||||
data = self._subscriptions[module][jid][keyword]["data"]
|
||||
tmp[jid] = data
|
||||
|
||||
return tmp
|
||||
return {
|
||||
jid: self._subscriptions[module][jid][keyword]["data"]
|
||||
for jid in self._subscriptions[module]
|
||||
if keyword in self._subscriptions[module][jid]
|
||||
}
|
||||
|
||||
def get_subscriptions_for_keywords(self, module, keywords):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user