projects
/
profile
/
ivi
/
qtbase.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5533cc9
)
Minor QObject::receivers() optimization.
author
Michael Brasser
<michael.brasser@nokia.com>
Thu, 19 Apr 2012 02:24:25 +0000
(12:24 +1000)
committer
Qt by Nokia
<qt-info@nokia.com>
Thu, 19 Apr 2012 22:32:53 +0000
(
00:32
+0200)
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>
src/corelib/kernel/qobject.cpp
patch
|
blob
|
history
diff --git
a/src/corelib/kernel/qobject.cpp
b/src/corelib/kernel/qobject.cpp
index
e35da80
..
a633f50
100644
(file)
--- a/
src/corelib/kernel/qobject.cpp
+++ b/
src/corelib/kernel/qobject.cpp
@@
-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()) {