diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2021-06-02 16:15:12 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2021-06-11 20:25:05 +0200 |
commit | aabdf87657e6f14e7f6713702f97a2129890611e (patch) | |
tree | 53df38ad5b01b74f48a23d3a52a27868d82952b5 /src/corelib | |
parent | 16f695f8a83155f448c68b33c577ba52d25420a1 (diff) |
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>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qstring.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index db6c1487c8..d68721b0df 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<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; } |