From 4262f31330ea48c384396e40dc50811b97642575 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 18 Dec 2015 14:20:13 +0100 Subject: QDaemonThread: replace a function pointer with a lambda Saves around 0.5KiB in text size on optimized GCC 5.3 Linux AMD 64 builds. Change-Id: Iaf2664e670a96136031bac67e4012d4f7324eb47 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/thread/qthread.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/corelib/thread/qthread.cpp') diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 14209d8d8cd..f689ad4d213 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -883,16 +883,12 @@ bool QThread::isInterruptionRequested() const Note: don't try to deliver events from the started() signal. */ -static void setThreadDoesNotRequireCoreApplication() -{ - QThreadData::current()->requiresCoreApplication = false; -} - QDaemonThread::QDaemonThread(QObject *parent) : QThread(parent) { // QThread::started() is emitted from the thread we start - connect(this, &QThread::started, setThreadDoesNotRequireCoreApplication); + connect(this, &QThread::started, + [](){ QThreadData::current()->requiresCoreApplication = false; }); } QDaemonThread::~QDaemonThread() -- cgit v1.2.3