summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-06-19 18:40:35 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2017-07-07 18:09:44 +0000
commitddcbe23f20757790ebab4b554f9cfcc77871f08e (patch)
tree88789e0f2ef38c40866aaa0ba537fc23450aee26
parent3a31c708790ba2bb3cf3dab32a17a83659a1acde (diff)
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>
-rw-r--r--qmake/option.cpp17
1 files 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;
}