From aabdf87657e6f14e7f6713702f97a2129890611e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 2 Jun 2021 16:15:12 +0200 Subject: [PATCH] QLatin1String: Remove a non-null assert in comparison It's a latin-1 string so embedded nulls are weird, but it makes it easier for the follow-up patch adding overloads for QLatin1Char. A test case in tst_qstringapisymmetry.cpp, which checks handling of "empty" values, end up with a '\0' latin-1 char. Which makes the code assert. Change-Id: I0ff6628087cfac4d875b19f572c59ef7b5406293 Reviewed-by: Thiago Macieira --- src/corelib/text/qstring.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index db6c1487c8e..d68721b0dfe 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1237,7 +1237,6 @@ static int latin1nicmp(const char *lhsChar, qsizetype lSize, const char *rhsChar const uchar *rhs = reinterpret_cast(rhsChar); Q_ASSERT(lhs && rhs); // since both lSize and rSize are positive for (qsizetype i = 0; i < size; i++) { - Q_ASSERT(lhs[i] && rhs[i]); if (int res = latin1Lower[lhs[i]] - latin1Lower[rhs[i]]) return res; }