From ddcbe23f20757790ebab4b554f9cfcc77871f08e Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 19 Jun 2017 18:40:35 +0200 Subject: [PATCH] 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 --- qmake/option.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qmake/option.cpp b/qmake/option.cpp index 4da2a1ae2c..9737f1f680 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -352,16 +352,19 @@ Option::init(int argc, char **argv) } } } - if (!globals->qmake_abslocation.isNull()) - globals->qmake_abslocation = QDir::cleanPath(globals->qmake_abslocation); - else // This is rather unlikely to ever happen on a modern system ... - globals->qmake_abslocation = QLibraryInfo::rawLocation(QLibraryInfo::HostBinariesPath, - QLibraryInfo::EffectivePaths) + + if (Q_UNLIKELY(globals->qmake_abslocation.isNull())) { + // This is rather unlikely to ever happen on a modern system ... + globals->qmake_abslocation = QLibraryInfo::rawLocation( + QLibraryInfo::HostBinariesPath, + QLibraryInfo::EffectivePaths) #ifdef Q_OS_WIN - "/qmake.exe"; + + "/qmake.exe"; #else - "/qmake"; + + "/qmake"; #endif + } else { + globals->qmake_abslocation = QDir::cleanPath(globals->qmake_abslocation); + } } else { Option::qmake_mode = Option::QMAKE_GENERATE_MAKEFILE; }