summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorJohn Brooks <special@dereferenced.net>2010-08-12 08:14:25 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2010-08-12 08:14:25 (GMT)
commitcf13b06e88e68ca966d6327c0e12cc7b89d616fc (patch)
treee3065f95b29cfbcf329df638ef59f8656bc7a0d2 /src/corelib/kernel
parentac45e864d49eb114747611357704324875086e5e (diff)
downloadQt-cf13b06e88e68ca966d6327c0e12cc7b89d616fc.zip
Qt-cf13b06e88e68ca966d6327c0e12cc7b89d616fc.tar.gz
Qt-cf13b06e88e68ca966d6327c0e12cc7b89d616fc.tar.bz2
Cleanup the connection list logic in QObject::sender
Merge-request: 2433 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 143dbff..9ce111d 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2298,13 +2298,12 @@ QObject *QObject::sender() const
if (!d->currentSender)
return 0;
- // Return 0 if d->currentSender isn't in d->senders
- bool found = false;
- for (QObjectPrivate::Connection *c = d->senders; c && !found; c = c->next)
- found = (c->sender == d->currentSender->sender);
- if (!found)
- return 0;
- return d->currentSender->sender;
+ for (QObjectPrivate::Connection *c = d->senders; c; c = c->next) {
+ if (c->sender == d->currentSender->sender)
+ return d->currentSender->sender;
+ }
+
+ return 0;
}
/*!