Use discard on set instead of catching exception

This commit is contained in:
Paul Nameless 2020-07-01 20:12:45 +08:00
parent 718bf5a7a7
commit 7fca99e377

View file

@ -336,10 +336,7 @@ class MsgModel:
]
msg_set = self.msg_ids[chat_id]
for msg_id in msg_ids:
try:
msg_set.remove(msg_id)
except KeyError:
continue
msg_set.discard(msg_id)
def update_msg_content_opened(self, chat_id: int, msg_id: int) -> None:
for message in self.msgs[chat_id]: