qDBusRealAddTimeout(): don't create a QList just to check it's empty
Instead of QHash::keys(value).isEmpty(), use QHash::key(value, 0) == 0 (0 is used a failure indicator three lines down, so it should not be a key in the hash table). Change-Id: I75cc4f7f7540dc5c51a7b8e3add09a0ec6a75e05 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This commit is contained in:
parent
dd788e0dc8
commit
9f1646b0d9
@ -160,7 +160,7 @@ static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
|
||||
|
||||
static bool qDBusRealAddTimeout(QDBusConnectionPrivate *d, DBusTimeout *timeout, int ms)
|
||||
{
|
||||
Q_ASSERT(d->timeouts.keys(timeout).isEmpty());
|
||||
Q_ASSERT(d->timeouts.key(timeout, 0) == 0);
|
||||
|
||||
int timerId = d->startTimer(ms);
|
||||
if (!timerId)
|
||||
|
Loading…
Reference in New Issue
Block a user