Mark an unlikely test as such and condition in positive order

Also wrap two blocks in braces, since the formerly-else block spreads
across many lines; and split those lines differently to limit length.

Change-Id: Ib89329b11aad6599926f0338d6546f4141d2c002
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Edward Welbourne 2017-06-19 18:40:35 +02:00
parent 3a31c70879
commit ddcbe23f20

View File

@ -352,16 +352,19 @@ Option::init(int argc, char **argv)
} }
} }
} }
if (!globals->qmake_abslocation.isNull()) if (Q_UNLIKELY(globals->qmake_abslocation.isNull())) {
globals->qmake_abslocation = QDir::cleanPath(globals->qmake_abslocation); // This is rather unlikely to ever happen on a modern system ...
else // This is rather unlikely to ever happen on a modern system ... globals->qmake_abslocation = QLibraryInfo::rawLocation(
globals->qmake_abslocation = QLibraryInfo::rawLocation(QLibraryInfo::HostBinariesPath, QLibraryInfo::HostBinariesPath,
QLibraryInfo::EffectivePaths) + QLibraryInfo::EffectivePaths)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
"/qmake.exe"; + "/qmake.exe";
#else #else
"/qmake"; + "/qmake";
#endif #endif
} else {
globals->qmake_abslocation = QDir::cleanPath(globals->qmake_abslocation);
}
} else { } else {
Option::qmake_mode = Option::QMAKE_GENERATE_MAKEFILE; Option::qmake_mode = Option::QMAKE_GENERATE_MAKEFILE;
} }