Simplify SendProgressManager::done prototype.

This commit is contained in:
John Preston 2022-11-10 09:19:43 +04:00
parent ca460dab6d
commit b514496546
2 changed files with 3 additions and 5 deletions

View File

@ -141,7 +141,7 @@ void SendProgressManager::send(const Key &key, int progress) {
MTP_int(key.topMsgId), MTP_int(key.topMsgId),
action action
)).done([=](const MTPBool &result, mtpRequestId requestId) { )).done([=](const MTPBool &result, mtpRequestId requestId) {
done(result, requestId); done(requestId);
}).send(); }).send();
_requests.emplace(key, requestId); _requests.emplace(key, requestId);
@ -171,9 +171,7 @@ bool SendProgressManager::skipRequest(const Key &key) const {
} }
} }
void SendProgressManager::done( void SendProgressManager::done(mtpRequestId requestId) {
const MTPBool &result,
mtpRequestId requestId) {
for (auto i = _requests.begin(), e = _requests.end(); i != e; ++i) { for (auto i = _requests.begin(), e = _requests.end(); i != e; ++i) {
if (i->second == requestId) { if (i->second == requestId) {
_requests.erase(i); _requests.erase(i);

View File

@ -90,7 +90,7 @@ private:
bool updated(const Key &key, bool doing); bool updated(const Key &key, bool doing);
void send(const Key &key, int progress); void send(const Key &key, int progress);
void done(const MTPBool &result, mtpRequestId requestId); void done(mtpRequestId requestId);
[[nodiscard]] bool skipRequest(const Key &key) const; [[nodiscard]] bool skipRequest(const Key &key) const;