diff options
author | Liang Qi <liang.qi@qt.io> | 2019-09-04 07:03:54 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-09-04 16:30:02 +0200 |
commit | 663c27a2b1066fccd6deca131e166ecadceb6b98 (patch) | |
tree | 3e621fb95c933c0fc3e3d8532dc6aed0636dc3ce /src/corelib/text | |
parent | 21ba294345377ad991a9c9bd8d51cd71094411b8 (diff) | |
parent | 6a36fe904c7183aba8e7f1977ff86303d84ff62b (diff) |
Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"
Diffstat (limited to 'src/corelib/text')
-rw-r--r-- | src/corelib/text/qregexp.cpp | 24 | ||||
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
2 files changed, 11 insertions, 17 deletions
diff --git a/src/corelib/text/qregexp.cpp b/src/corelib/text/qregexp.cpp index 41f3508ff8..ac4d9bbc36 100644 --- a/src/corelib/text/qregexp.cpp +++ b/src/corelib/text/qregexp.cpp @@ -3008,12 +3008,10 @@ int QRegExpEngine::getEscape() yyCharClass->addSingleton(0x005f); // '_' return Tok_CharClass; case 'I': - if (xmlSchemaExtensions) { - yyCharClass->setNegative(!yyCharClass->negative()); - Q_FALLTHROUGH(); - } else { + if (!xmlSchemaExtensions) break; - } + yyCharClass->setNegative(!yyCharClass->negative()); + Q_FALLTHROUGH(); case 'i': if (xmlSchemaExtensions) { yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) | @@ -3048,12 +3046,10 @@ int QRegExpEngine::getEscape() break; } case 'C': - if (xmlSchemaExtensions) { - yyCharClass->setNegative(!yyCharClass->negative()); - Q_FALLTHROUGH(); - } else { + if (!xmlSchemaExtensions) break; - } + yyCharClass->setNegative(!yyCharClass->negative()); + Q_FALLTHROUGH(); case 'c': if (xmlSchemaExtensions) { yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) | @@ -3094,12 +3090,10 @@ int QRegExpEngine::getEscape() break; } case 'P': - if (xmlSchemaExtensions) { - yyCharClass->setNegative(!yyCharClass->negative()); - Q_FALLTHROUGH(); - } else { + if (!xmlSchemaExtensions) break; - } + yyCharClass->setNegative(!yyCharClass->negative()); + Q_FALLTHROUGH(); case 'p': if (xmlSchemaExtensions) { if (yyCh != '{') { diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 375843e36e..4d8eff113f 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1193,10 +1193,10 @@ static int qt_compare_strings(QLatin1String lhs, QStringView rhs, Qt::CaseSensit static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept { - if (cs == Qt::CaseInsensitive) - return qstrnicmp(lhs.data(), lhs.size(), rhs.data(), rhs.size()); if (lhs.isEmpty()) return lencmp(0, rhs.size()); + if (cs == Qt::CaseInsensitive) + return qstrnicmp(lhs.data(), lhs.size(), rhs.data(), rhs.size()); const auto l = std::min(lhs.size(), rhs.size()); int r = qstrncmp(lhs.data(), rhs.data(), l); return r ? r : lencmp(lhs.size(), rhs.size()); |