diff options
Diffstat (limited to 'src/corelib/tools/qcommandlineoption.cpp')
-rw-r--r-- | src/corelib/tools/qcommandlineoption.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp index 14ee674cb9..e6fccf0443 100644 --- a/src/corelib/tools/qcommandlineoption.cpp +++ b/src/corelib/tools/qcommandlineoption.cpp @@ -252,15 +252,15 @@ namespace { result_type operator()(const QString &name) const Q_DECL_NOEXCEPT { - if (name.isEmpty()) + if (Q_UNLIKELY(name.isEmpty())) return warn("be empty"); const QChar c = name.at(0); - if (c == QLatin1Char('-')) + if (Q_UNLIKELY(c == QLatin1Char('-'))) return warn("start with a '-'"); - if (c == QLatin1Char('/')) + if (Q_UNLIKELY(c == QLatin1Char('/'))) return warn("start with a '/'"); - if (name.contains(QLatin1Char('='))) + if (Q_UNLIKELY(name.contains(QLatin1Char('=')))) return warn("contain a '='"); return false; @@ -276,7 +276,7 @@ namespace { // static QStringList QCommandLineOptionPrivate::removeInvalidNames(QStringList nameList) { - if (nameList.isEmpty()) + if (Q_UNLIKELY(nameList.isEmpty())) qWarning("QCommandLineOption: Options must have at least one name"); else nameList.erase(std::remove_if(nameList.begin(), nameList.end(), IsInvalidName()), |