1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 00:11:20 +01:00

Small optimization

This commit is contained in:
Daniil Gentili 2023-11-09 21:03:24 +01:00
parent 10f22111ac
commit 500cda829f

View File

@ -270,6 +270,12 @@ trait UpdateHandler
'timeout' => $timeout
] = array_merge(['offset' => 0, 'limit' => null, 'timeout' => INF], $params);
foreach ($this->updates as $key => $value) {
if ($offset > $key) {
unset($this->updates[$key]);
}
}
if (!$this->updates) {
try {
$this->update_deferred = new DeferredFuture();