QByteArray::setNum: use the existing latin1 lowercasing table

Not sure this makes the code faster, but it removes two functions.

Change-Id: I5d0ee9389a794d80983efffd152d830da44b1bfe
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Thiago Macieira 2018-05-10 23:25:43 -07:00
parent 8c029e98bf
commit 69e0393399
1 changed files with 3 additions and 15 deletions

View File

@ -782,19 +782,6 @@ QByteArray qUncompress(const uchar* data, int nbytes)
}
#endif
static inline bool qIsUpper(char c)
{
return c >= 'A' && c <= 'Z';
}
static inline char qToLower(char c)
{
if (c >= 'A' && c <= 'Z')
return c - 'A' + 'a';
else
return c;
}
/*!
\class QByteArray
\inmodule QtCore
@ -4136,9 +4123,10 @@ QByteArray &QByteArray::setNum(double n, char f, int prec)
QLocaleData::DoubleForm form = QLocaleData::DFDecimal;
uint flags = QLocaleData::ZeroPadExponent;
if (qIsUpper(f))
char lower = latin1_lowercased[uchar(f)];
if (f != lower)
flags |= QLocaleData::CapitalEorX;
f = qToLower(f);
f = lower;
switch (f) {
case 'f':