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 <thiago.macieira@intel.com>
This commit is contained in:
Mårten Nordheim 2021-06-02 16:15:12 +02:00
parent 16f695f8a8
commit aabdf87657

View File

@ -1237,7 +1237,6 @@ static int latin1nicmp(const char *lhsChar, qsizetype lSize, const char *rhsChar
const uchar *rhs = reinterpret_cast<const uchar *>(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;
}