aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs/basejob.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-12-27 23:32:18 +0100
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-12-28 11:20:47 +0100
commit12c37cf3ce2aa397050fff6ce846d557524a3fe7 (patch)
tree81835033f7f418b2386634489fe18fe82f58623a /lib/jobs/basejob.cpp
parentf286ef4c5b3c71510d6ef15e8cc12cada84f3682 (diff)
downloadlibquotient-12c37cf3ce2aa397050fff6ce846d557524a3fe7.tar.gz
libquotient-12c37cf3ce2aa397050fff6ce846d557524a3fe7.zip
BaseJob::initiate: add Q_LIKELY
...to show the sunny-day case. (cherry picked from commit 5d15e3b23649a54abdb3812c10f4a7d2ce07d7dd)
Diffstat (limited to 'lib/jobs/basejob.cpp')
-rw-r--r--lib/jobs/basejob.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index 2ac942f5..135274d6 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -342,7 +342,7 @@ void BaseJob::beforeAbandon() { }
void BaseJob::initiate(ConnectionData* connData, bool inBackground)
{
- if (connData && connData->baseUrl().isValid()) {
+ if (Q_LIKELY(connData && connData->baseUrl().isValid())) {
d->inBackground = inBackground;
d->connection = connData;
doPrepare();
@@ -355,7 +355,7 @@ void BaseJob::initiate(ConnectionData* connData, bool inBackground)
setStatus(FileError, "Request data not ready");
}
Q_ASSERT(status().code != Pending); // doPrepare() must NOT set this
- if (status().code == Unprepared) {
+ if (Q_LIKELY(status().code == Unprepared)) {
d->connection->submit(this);
return;
}