summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 8fd9dc96cf..9b13d4a276 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -6267,7 +6267,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const noexcept
\since 5.0
*/
int QString::compare_helper(const QChar *data1, qsizetype length1, const char *data2, qsizetype length2,
- Qt::CaseSensitivity cs)
+ Qt::CaseSensitivity cs) noexcept
{
Q_ASSERT(length1 >= 0);
Q_ASSERT(data1 || length1 == 0);
@@ -6275,11 +6275,8 @@ int QString::compare_helper(const QChar *data1, qsizetype length1, const char *d
return length1;
if (Q_UNLIKELY(length2 < 0))
length2 = qsizetype(strlen(data2));
- // ### make me nothrow in all cases
- QVarLengthArray<ushort> s2(length2);
- const auto beg = reinterpret_cast<QChar *>(s2.data());
- const auto end = QUtf8::convertToUnicode(beg, QByteArrayView(data2, length2));
- return QtPrivate::compareStrings(QStringView(data1, length1), QStringView(beg, end - beg), cs);
+ return QtPrivate::compareStrings(QStringView(data1, length1),
+ QUtf8StringView(data2, length2), cs);
}
/*!