From f553e521cec4e468442f98f012bdc354d5d3c805 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 10 Apr 2018 16:26:04 +0200 Subject: [PATCH] Use sets instead of lists or tuples For faster checks --- pyrogram/client/filters/filters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index 1a70f130..1eb8d645 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -41,9 +41,9 @@ class Filters: and (m.text[1:].split()[0] in _.c) ), c=( - [command] + {command} if not isinstance(command, list) - else command + else {c for c in command} ) ) @@ -64,7 +64,7 @@ class Filters: venue = build("Venue", lambda _, m: bool(m.venue)) private = build("Private", lambda _, m: bool(m.chat.type == "private")) - group = build("Group", lambda _, m: bool(m.chat.type in ("group", "supergroup"))) + group = build("Group", lambda _, m: bool(m.chat.type in {"group", "supergroup"})) channel = build("Channel", lambda _, m: bool(m.chat.type == "channel")) @staticmethod