From 2d6705575cfcd5abb0d66f2aa94df92f4dda3e81 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 30 Jul 2020 16:30:00 +0200 Subject: Don't second-guess strcoll() It's defective on Android, but no worse so than the fall-back we were using; and we can't remember why we had that fall-back anyway. Task-number: QTBUG-63518 Change-Id: I28e9b5c7cc64963c9e3941eb1bad85aced280a9b Reviewed-by: Lars Knoll --- src/corelib/text/qstring.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 879a7e5cd7..24859b6e7a 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1655,9 +1655,7 @@ inline char qToLower(char ch) localeAwareCompare() compares according the "Order for sorted lists" setting in the International preferences panel. On other Unix-like systems without ICU, the comparison falls back to the - system library's \c strcoll(), falling back when it considers - strings equal to QString's (locale-unaware) comparison, described - above, + system library's \c strcoll(), \section1 Converting Between encoded strings data and QString @@ -5931,11 +5929,8 @@ int QString::localeAwareCompare_helper(const QChar *data1, qsizetype length1, CFRelease(otherString); return result; # elif defined(Q_OS_UNIX) - // declared in - int delta = strcoll(lhs.toLocal8Bit().constData(), rhs.toLocal8Bit().constData()); - if (delta == 0) - delta = qt_compare_strings(lhs, rhs, Qt::CaseSensitive); - return delta; + // declared in (no better than qt_compare_strings() on Android, sadly) + return strcoll(lhs.toLocal8Bit().constData(), rhs.toLocal8Bit().constData()); # else # error "This case shouldn't happen" return qt_compare_strings(lhs, rhs, Qt::CaseSensitive); -- cgit v1.2.3