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

Avoid certain yield issues

This commit is contained in:
Daniil Gentili 2020-11-28 23:42:48 +01:00
parent db08a8c167
commit 00150a1045
5 changed files with 5 additions and 5 deletions

2
docs

@ -1 +1 @@
Subproject commit 2afa14cd21754fbbcbc8bd25cecfeb3592662eca
Subproject commit e83c3ea026fc2142b6558378d0c9636c8c29f248

@ -1 +1 @@
Subproject commit d0b2b612cbece1fd3dc971634326f7470dc0099b
Subproject commit 8fd40f0a4170769465e4943e4a5da37bd58f7e88

View File

@ -85,7 +85,7 @@ abstract class SqlArray extends DriverArray
*/
public function isset($key): Promise
{
return call(fn () => yield $this->offsetGet($key) !== null);
return call(fn () => null !== yield $this->offsetGet($key));
}

View File

@ -746,7 +746,7 @@ class MTProto extends AsyncConstruct implements TLCallback
yield $this->usernames->clear();
return;
}
if (yield $this->usernames->count() === 0) {
if (!yield $this->usernames->count()) {
$this->logger('Filling database cache. This can take few minutes.', Logger::WARNING);
$iterator = $this->chats->getIterator();
while (yield $iterator->advance()) {

View File

@ -84,7 +84,7 @@ class MinDatabase implements TLCallback
if (!$this->API->getSettings()->getDb()->getEnableMinDb()) {
yield $this->db->clear();
}
if ($this->clean || yield $this->db->count() === 0) {
if ($this->clean || 0 === yield $this->db->count()) {
$this->clean = true;
return;
}