Minor QObject::receivers() optimization.
Don't lock if there are no receivers. Change-Id: I922fad10436adeb27aa4f193cc0dcbaa3f0c0f1e Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
5533cc9953
commit
7e9f7080b7
@ -2190,6 +2190,9 @@ int QObject::receivers(const char *signal) const
|
||||
metaObject()->indexOfMethod(signal));
|
||||
}
|
||||
|
||||
if (!d->isSignalConnected(signal_index))
|
||||
return receivers;
|
||||
|
||||
QMutexLocker locker(signalSlotLock(this));
|
||||
if (d->connectionLists) {
|
||||
if (signal_index < d->connectionLists->count()) {
|
||||
|
Loading…
Reference in New Issue
Block a user