diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-17 08:55:20 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-02-19 02:09:35 +0100 |
commit | 0f52ec8d5265e23f563f91a290a60e7d8e714166 (patch) | |
tree | c395f83976abed71ae9efe8143d267579a094828 /src/corelib/text/qbytearray.cpp | |
parent | be2745e4788cecb0d3122081e3328e4b66923609 (diff) |
QByteArray: Extract Function QtMiscUtils::caseCompareAscii()
Change-Id: Id9c385f4df4f33792738cd134fabb9cc03cab809
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearray.cpp')
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index c587e9c254..9f768484b6 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -272,7 +272,7 @@ int qstricmp(const char *str1, const char *str2) max += offset; do { uchar c = s1[offset]; - if (int res = asciiLower(c) - asciiLower(s2[offset])) + if (int res = QtMiscUtils::caseCompareAscii(c, s2[offset])) return res; if (!c) return 0; @@ -355,7 +355,7 @@ int qstrnicmp(const char *str1, const char *str2, size_t len) return s1 ? 1 : (s2 ? -1 : 0); for (; len--; ++s1, ++s2) { const uchar c = *s1; - if (int res = asciiLower(c) - asciiLower(*s2)) + if (int res = QtMiscUtils::caseCompareAscii(c, *s2)) return res; if (!c) // strings are equal break; @@ -396,7 +396,7 @@ int qstrnicmp(const char *str1, qsizetype len1, const char *str2, qsizetype len2 if (!c) return 1; - if (int res = asciiLower(s1[i]) - asciiLower(c)) + if (int res = QtMiscUtils::caseCompareAscii(s1[i], c)) return res; } return s2[i] ? -1 : 0; @@ -404,7 +404,7 @@ int qstrnicmp(const char *str1, qsizetype len1, const char *str2, qsizetype len2 // not null-terminated const qsizetype len = qMin(len1, len2); for (qsizetype i = 0; i < len; ++i) { - if (int res = asciiLower(s1[i]) - asciiLower(s2[i])) + if (int res = QtMiscUtils::caseCompareAscii(s1[i], s2[i])) return res; } if (len1 == len2) |