From 4c32a15cfdd3aef38bbee8a6863615461aad5424 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 25 Dec 2022 10:30:56 +0100 Subject: [PATCH] Remove unneeded threading.Lock --- pyrogram/session/internals/seq_no.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pyrogram/session/internals/seq_no.py b/pyrogram/session/internals/seq_no.py index 0abc4a2f..79501d98 100644 --- a/pyrogram/session/internals/seq_no.py +++ b/pyrogram/session/internals/seq_no.py @@ -16,19 +16,15 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from threading import Lock - class SeqNo: def __init__(self): self.content_related_messages_sent = 0 - self.lock = Lock() def __call__(self, is_content_related: bool) -> int: - with self.lock: - seq_no = (self.content_related_messages_sent * 2) + (1 if is_content_related else 0) + seq_no = (self.content_related_messages_sent * 2) + (1 if is_content_related else 0) - if is_content_related: - self.content_related_messages_sent += 1 + if is_content_related: + self.content_related_messages_sent += 1 - return seq_no + return seq_no