Drop hand-rolled ASCII conversion from QAbstractConcatenable::convertFromAscii()
QUtf8::convertToUnicode() contains a SIMD-enabled ASCII fast-path already which is likely faster than what the compiler will emit for the old code here. Change-Id: I6afae9689424eb53a9f7c01359cc4f57ffcead26 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
50388a7e4f
commit
0cffd65930
@ -110,25 +110,11 @@ QT_BEGIN_NAMESPACE
|
||||
*/
|
||||
void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) Q_DECL_NOTHROW
|
||||
{
|
||||
if (len == -1) {
|
||||
if (Q_UNLIKELY(len == -1)) {
|
||||
if (!a)
|
||||
return;
|
||||
while (*a && uchar(*a) < 0x80U)
|
||||
*out++ = QLatin1Char(*a++);
|
||||
if (!*a)
|
||||
return;
|
||||
len = int(strlen(a));
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; i < len && uchar(a[i]) < 0x80U; ++i)
|
||||
*out++ = QLatin1Char(a[i]);
|
||||
if (i == len)
|
||||
return;
|
||||
a += i;
|
||||
len -= i;
|
||||
}
|
||||
|
||||
// we need to complement with UTF-8 appending
|
||||
out = QUtf8::convertToUnicode(out, a, len);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user