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:19:57 +0100
commit5d15e3b23649a54abdb3812c10f4a7d2ce07d7dd (patch)
tree6a202bb6072f7f93d88c1001034a98e12dac9af8 /lib/jobs/basejob.cpp
parent56c1db077b5da653c230432abc6c746318a77bed (diff)
downloadlibquotient-5d15e3b23649a54abdb3812c10f4a7d2ce07d7dd.tar.gz
libquotient-5d15e3b23649a54abdb3812c10f4a7d2ce07d7dd.zip
BaseJob::initiate: add Q_LIKELY
...to show the sunny-day case.
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 1a41f795..d37f05bc 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;
}