2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Optimize InvokeQueued().

This commit is contained in:
John Preston
2019-07-10 17:03:15 +02:00
parent c3c6571835
commit 90fb9eccd4
6 changed files with 60 additions and 11 deletions

View File

@@ -14,10 +14,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/assertion.h"
#include "base/bytes.h"
#include <crl/crl_time.h>
#include <QtCore/QReadWriteLock>
#include <QtCore/QRegularExpression>
#include <QtNetwork/QNetworkProxy>
#include <cmath>
#include <set>
@@ -55,12 +55,6 @@ inline bool in_range(Value &&value, From &&from, Till &&till) {
// while "for_const (T *p, v)" won't and "for_const (T *&p, v)" won't compile
#define for_const(range_declaration, range_expression) for (range_declaration : std::as_const(range_expression))
template <typename Lambda>
inline void InvokeQueued(const QObject *context, Lambda &&lambda) {
QObject proxy;
QObject::connect(&proxy, &QObject::destroyed, context, std::forward<Lambda>(lambda), Qt::QueuedConnection);
}
static const int32 ScrollMax = INT_MAX;
extern uint64 _SharedMemoryLocation[];