diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2025-10-16 11:17:20 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2025-10-19 18:25:11 +0200 |
| commit | 3eab7aca75fc44677e6b3f0e050b8f3ea174d0bd (patch) | |
| tree | c5ef7f18e1864886ae43e6f6ba808af996c38444 /src/corelib/text/qstring.cpp | |
| parent | 59259fdc7362035889c075b5071c355ae41672f1 (diff) | |
QChar: remove confusing foldCase(ch, ch&) overload
For years, I've been confused by the various foldCase() overloads,
until Clang 21 -Wcharacter-conversion now forced me down the rabbit
hole.
Turns out that there's just one user of the ch,ch& overload and it's
readily ported to the ch*,ch* overload, so do that and remove the
now-unused overload.
Amends the start of the public history.
Pick-to: 6.10 6.8 6.5
Change-Id: I8ddd22b08423540f58c1a5fe0ef36c93c8b337f1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
| -rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 615cf3e6752..46c01bf232a 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1197,15 +1197,13 @@ Q_NEVER_INLINE static int ucstricmp(qsizetype alen, const char16_t *a, qsizetype if (a == b) return qt_lencmp(alen, blen); - char16_t alast = 0; - char16_t blast = 0; qsizetype l = qMin(alen, blen); qsizetype i; for (i = 0; i < l; ++i) { // qDebug() << Qt::hex << alast << blast; // qDebug() << Qt::hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast); // qDebug() << Qt::hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast); - int diff = foldCase(a[i], alast) - foldCase(b[i], blast); + int diff = foldCase(a + i, a) - foldCase(b + i, b); if ((diff)) return diff; } |
