summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-12-18 14:20:13 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-17 16:17:29 +0000
commit4262f31330ea48c384396e40dc50811b97642575 (patch)
treebe548802a01e2ca942906de2f6a94686e4ff84a8 /src/corelib
parent66e26430727bc76557b99c8e2b136901c5a38f90 (diff)
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) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qthread.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 14209d8d8c..f689ad4d21 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()