Skip to content

Commit dedbc62

Browse files
authored
simplify public_subscribe update
1 parent 7e33a0d commit dedbc62

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

publish_subscribe.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ def unsubscribe(self, msg, subscriber):
2424

2525
def update(self):
2626
for msg in self.msg_queue:
27-
if msg in self.subscribers:
28-
for sub in self.subscribers[msg]:
29-
sub.run(msg)
27+
for sub in self.subscribers.get(msg, []):
28+
sub.run(msg)
3029
self.msg_queue = []
3130

3231

0 commit comments

Comments
 (0)