diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-07-30 16:30:00 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-08-28 21:27:24 +0200 |
commit | 2d6705575cfcd5abb0d66f2aa94df92f4dda3e81 (patch) | |
tree | 12db7f4f980a90a551cf1340722f31ad652db80c /src/corelib | |
parent | 2d5dcd1b9f8683f13112913a760e27d13e9e88d0 (diff) |
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 <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qstring.cpp | 11 |
1 files 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 <string.h> - int delta = strcoll(lhs.toLocal8Bit().constData(), rhs.toLocal8Bit().constData()); - if (delta == 0) - delta = qt_compare_strings(lhs, rhs, Qt::CaseSensitive); - return delta; + // declared in <string.h> (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); |