Prevent detaching temporary objects

For more info see:
https://blogs.kde.org/2015/05/13/simple-qt-container-optimization-you-should-do-your-code
This commit is contained in:
Aleix Pol 2015-09-12 09:53:05 +02:00
parent c6a157e50a
commit a8a8080248
2 changed files with 3 additions and 3 deletions

View file

@ -49,7 +49,7 @@ QVariant DBusResponseWaiter::waitForReply(QVariant variant) const
if (reply.arguments().count() > 0)
{
return reply.arguments().first();
return reply.arguments().at(0);
}
}
return QVariant();
@ -95,7 +95,7 @@ void DBusAsyncResponse::onCallFinished(QDBusPendingCallWatcher* watcher)
if (reply.arguments().count() > 0)
{
Q_EMIT success(reply.arguments().first());
Q_EMIT success(reply.arguments().at(0));
}
else
{

View file

@ -51,7 +51,7 @@ ScreensaverInhibitPlugin::ScreensaverInhibitPlugin(QObject* parent, const QVaria
inhibitCookie = 0;
} else {
// Store the cookie we receive, this will be sent back when sending the uninhibit call.
inhibitCookie = reply.arguments().first().toUInt();
inhibitCookie = reply.arguments().at(0).toUInt();
}
}