diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-17 09:11:55 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-02-19 07:29:37 +0100 |
commit | 0ef4e6d4bfdb4a783167bc0cddeeb2059183bf9b (patch) | |
tree | 3a5a1cbb124e3191ac38140aa8cd321751878aec /src/corelib/text/qstring.cpp | |
parent | 0f52ec8d5265e23f563f91a290a60e7d8e714166 (diff) |
Use QtMiscUtils::toAsciiLower() around the code
... instead of self-rolled versions in at least three TUs.
QByteArray's asciiLower() cannot be completely removed, yet, because
it's used for indirect calls.
Change-Id: Icf4e7605184f0a1157967c78cbd7632b283c4a9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 6be5cd668e..72c839a478 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -45,6 +45,7 @@ #endif #include "qunicodetables_p.h" #include <private/qstringconverter_p.h> +#include <private/qtools_p.h> #include "qlocale_tools_p.h" #include "private/qsimd_p.h" #include <qnumeric.h> @@ -130,13 +131,6 @@ inline bool qIsDigit(char ch) return ch >= '0' && ch <= '9'; } -inline char qToLower(char ch) -{ - if (ch >= 'A' && ch <= 'Z') - return ch - 'A' + 'a'; - else - return ch; -} template <typename Pointer> char32_t foldCaseHelper(Pointer ch, Pointer start) = delete; @@ -6949,7 +6943,7 @@ QString QString::vasprintf(const char *cformat, va_list ap) flags |= QLocaleData::CapitalEorX; int base = 10; - switch (qToLower(*c)) { + switch (QtMiscUtils::toAsciiLower(*c)) { case 'o': base = 8; break; case 'u': @@ -6980,7 +6974,7 @@ QString QString::vasprintf(const char *cformat, va_list ap) flags |= QLocaleData::CapitalEorX; QLocaleData::DoubleForm form = QLocaleData::DFDecimal; - switch (qToLower(*c)) { + switch (QtMiscUtils::toAsciiLower(*c)) { case 'e': form = QLocaleData::DFExponent; break; case 'a': // not supported - decimal form used instead case 'f': form = QLocaleData::DFDecimal; break; @@ -7568,7 +7562,7 @@ QString QString::number(double n, char format, int precision) { QLocaleData::DoubleForm form = QLocaleData::DFDecimal; - switch (qToLower(format)) { + switch (QtMiscUtils::toAsciiLower(format)) { case 'f': form = QLocaleData::DFDecimal; break; @@ -8452,7 +8446,7 @@ QString QString::arg(double a, int fieldWidth, char format, int precision, QChar flags |= QLocaleData::CapitalEorX; QLocaleData::DoubleForm form = QLocaleData::DFDecimal; - switch (qToLower(format)) { + switch (QtMiscUtils::toAsciiLower(format)) { case 'f': form = QLocaleData::DFDecimal; break; |